I have set up virtual hosts seemingly correctly.
The httpd.conf file has these relevant lines
- Code: Select all
#ServerName localhost:80
<Directory />
AllowOverride none
Require all denied
</Directory>
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
My vhosts file has
- Code: Select all
NameVirtualHost *:80
<Directory C:/sites>
AllowOverride All
Require all granted
</Directory>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "C:/sites/mysite/public"
ServerName mysite.com
</VirtualHost>
And of course hosts file
- Code: Select all
127.0.0.1 mysite.com
No matter what I do mysite.com gets redirected to localhost/dashboard. I have tried with and without NameVirtualHost. I have confirmed that httpd-vhosts.conf is used because if I make a typo apache won't start. And yes - I restart apache after any conf file change. And log files don't point to anything.
I can't imagine why this isn't working. All paths are valid. Everything seems correct. But no mater what, localhost/dashboard wants to assert itself...
Ideas?
Thanks