Search code examples
phpapachevhosts

setting up vhost in xampp


I am facing a minor problem while setting up vhost in xampp os - windows. here is the httpd-vhosts.conf in C:\xampp\apache\conf\extra\httpd-vhosts.conf

<VirtualHost *:80>
  DocumentRoot "C:/xampp/htdocs/yiisite/basic/web/"
  ServerName yiisite

and in hosts file located C:\Windows\System32\drivers\etc\hosts

    127.0.0.1 yiisite

so when i hit i get http://yiisite i get what i want, but all other folders inside htdocs that i use to open in localhost/abc is all going to yiisite template 404 not found . cannot access other projects inside htdocs with localhost . if i change the port in vhosts.conf i can access localhost/abc but not yiisite


Solution

  • changing the httpd-vhosts.conf to

    <VirtualHost 127.0.0.1:80>
     DocumentRoot "C:/xampp/htdocs/yiisite/basic/web/"
     ServerName yiisite
    </VirtualHost>
    

    solved the issue of conflicting with other projects inside htdocs and can access with localhost/otherproject