Tuesday 1 October 2013

Changing "localhost" to a local domain name in Wamp

Changing "localhost" to a local domain name in Wamp

Im running Wamp on Windows 7, and i tried to change the domain for a local
website. Let me show you what I've done - I added this line to my hosts
file:
127.0.0.1 webpage.lh
and added this to my httpd.conf:
NameVirtualHost 127.0.0.1
<VirtualHost 127.0.0.1>
ServerName localhost
DocumentRoot "c:/Program Files/wamp/www/"
</VirtualHost>
<VirtualHost 127.0.0.1>
ServerName webpage.lh
DocumentRoot "c:/Program Files/wamp/www/webpage"
<Directory "c:/Program Files/wamp/www/webpage">
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>
Now, it worked, it did make "webpage.lh" redirect to the website page, but
the url changed to "localhost/webpage" after the request, and I didn't
wanted that to happen. Can anyone help me with that? -Thank's Ahead!

No comments:

Post a Comment