Apache virtual host always redirecting to /dashboard

Put this as the first line in C:\...\httpd-vhosts.conf (and restart the web server):

NameVirtualHost *:80

So, it should look like this:

NameVirtualHost *:80

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot "C:/xampp/htdocs"
</VirtualHost>

<VirtualHost *:80>
    ServerName walkpeakdistrict.local
    DocumentRoot "C:/xampp/htdocs/walkpeakdistrict_uk/public"
</VirtualHost>

I would place all my projects somewhere outside of C:/xampp/htdocs and C:/xampp. Let C:/xampp/htdocs be the standard localhost location, with just two files inside (simple index.php and index.html), but use another one for the projects. Even better, use another partition, not the system partition C:. Like D:/projects, or so. So, you would have D:/projects/walkpeakdistrict_uk.

Good luck.


Ok, I'm not sure why this was an issue but it seems to work when I change the virtual host's server name to anything other than ".local".

Thanks again to all who replied!