Reputation: 1321
i added in c:\Windows\System32\drivers\etc\hosts
127.0.0.1 mysite.com
in httpd-vhosts.conf
ServerAdmin [email protected]
DocumentRoot "c:/wamp/www/sf2/web/"
ServerName mysite.com
in httpd.conf uncommented "Include conf/extra/httpd-vhosts.conf"
mysite.com runs but now i have no acces to my older folders in c:\wamp\www is there a solution to have
"localhost/somefolder" ->opens "c:/wamp/www/somefolder"
"mysite.com" ->opens "c:/wamp/www/sf2/web/"
at the same time?
Upvotes: 0
Views: 123
Reputation: 94642
When you add virtual hosts you also have to create one for your localhost environment as well.
Also it is a good idea to create your vhosts outside the \wamp\www
folder structure. I used C:\websrc\www
in this example. It makes sure that the security for each site is not confused with another and if you change wamp you dont loose your site code by accident.
So try this in your httpd-vhosts.conf
Should be first vhost so the the wamp menu page loads
Also should keep the security as this PC and internal network only
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "C:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "C:/wamp/www">
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1 192.168.0
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "C:/websrc/www/sf2/web"
ServerName mysite.com
ServerAlias www.mysite.com
Options Indexes FollowSymLinks
<Directory "D:/websrc/www/sf2/web">
AllowOverride All
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1 192.168.0
</Directory>
</VirtualHost>
Upvotes: 2