I am using xampp.
I’ve set up a project in symfony and added this to apaches httpd.conf:
<VirtualHost 127.0.0.1:80>
ServerName www.plusoneboosters.com.localhost
DocumentRoot "C:\my_xampp\xampp\htdocs\plusoneboosters\web"
DirectoryIndex index.php
<Directory "C:\my_xampp\xampp\htdocs\plusoneboosters\web">
AllowOverride All
Allow from All
</Directory>
Alias /sf "C:\my_xampp\xampp\htdocs\plusoneboosters\lib\vendor\symfony\data\web\sf"
<Directory "C:\my_xampp\xampp\htdocs\plusoneboosters\lib\vendor\symfony\data\web\sf">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
I also added this to hosts file (Windows):
127.0.0.1 www.plusoneboosters.com.localhost
This project works, but all the projects that are not installed with symfony aren’t working anymore – running localhost/project/index.php will redirect to the symfony project.
I suspect this is happening because htaccess, but do not know what to replace in order to make it work.
I also tried adding another virtual host, didn’t work.
How can I work around this?
Edit: I think I found a solution.
I added another Virtual host in httpd.conf with a different IP: 127.0.0.2 and it seems to be working fine now. I’m not sure if this is the right way to do it though…
When you start to use virtual hosts you need to define at least two of them to keep your old configuration working otherwise your symphony vhost became the default vhost and intercept all the requests. So add to your apache configuration the following lines BEFORE the symphony vhost configuration
If you have access to apache command line tool you can check the vhost configuration and priority with
apachectl -Swhich gives you a report of all the defined virtual hostsApache virtual host examples