I had a lot of difficulties getting a domain of mine to point to a folder in my Wamp /www directory.
However, I'm now wanting to work on getting another domain working, but before that I'd like to work on the domain under localhost and edit it through there.
But, whenever I go to localhost or the Ip of the server on a browser, it goes to my domain.
I only want to go to that domain when I type the domains name, not when I type localhost on that machine or the IP on a different machine.
TL:Dr;
I want mywebsite.com > /www/mywebsite (this has already been done) I want localhost/ > /www (main folder)
Windows Server with WAMP
Here's my current htaccess to get the domain working with the folder (probably not an efficient way) Removed thanks to RiggsFolly
RewriteEngine On
RewriteCond %{HTTP_HOST} (?:www\.)?mywebsite\.com [NC]
RewriteCond %{REQUEST_URI} !^/mywebsite
RewriteRule ^(.*)$ /mywebsite/$1 [L]
RewriteRule ^(.*)$ http://mywebsite.comk/$1 [L,R=301]
After adding Virtual hosts
<VirtualHost *:80>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "c:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin info@mywebsite.com
DocumentRoot "c:/wamp/www/mywebsite"
ServerName mywebsite.com
ServerAlias www.mywebsite.com
ErrorLog "logs/mywebsite-error.log"
CustomLog "logs/mywebsite-access.log" common
</VirtualHost>
Still not working. localhost will load mywebsite.com (name changed for privacy). I want localhost to load the main directory not the mywebsite sub-directory!