swl1020
swl1020

Reputation: 823

Use Wamp without having to use projects

So, I love Wamp. It's great for development. The only downside is that in wamp, I have to code everything to use "localhost/projectname/" as a base, but on my actual site, everything has the base of just "/".

Is there a way to use wamp where it treats localhost has your website url?

Upvotes: 0

Views: 222

Answers (2)

vdegenne
vdegenne

Reputation: 13270

here's how I'm doing :

  1. I'm editing my httpd.conf file and append a virtual host at the bottom of it (in the dedicated lines) each time I want to add a new local website :

    <VirtualHost *:80>
        DocumentRoot "C:/wamp/www/fake"
        ServerName fakesite
    </VirtualHost>
    
  2. And I tell windows to point the local host address (127.0.0.1) from the hostname that I defined (fakesite in the example):

I'm using windows and I just edit the following file : X:\Windows\System32\drivers\etc\hosts and append a new line as follow : 127.0.0.1 fakesite

note : you'll need to restart wamp after edition config files.

This way and if everything went right you'll just need to type fakesite/xxx to reach the following physical folder : c:/wamp/www/fake/xxx

Upvotes: 1

Homer6
Homer6

Reputation: 15159

Can't you use VirtualBox to set up a real server, use apache vhosts to set a fake domain and edit your windows hosts file to point to your local server?

When I do that, I set up samba shares so I can still use Windows to edit my files, then hit "save" in the editor and just refresh the browser. Works like a charm.

Upvotes: 0

Related Questions