Apache virtual host always redirecting to /dashboard

al.tron picture al.tron · Jan 30, 2018 · Viewed 12.3k times · Source

I'm having what appears to be a common problem but any solutions I've found don't seem to work for my case.

I'm trying to set up a virtual host so that I can access the public file of my Laravel installation by going to "walkpeakdistrict.local" but when I type this address into google chrome I am always redirected to the xampp dashboard at this address "https://walkpeakdistrict.local/dashboard/".

I've installed Laravel in the following xampp directory: c:/xampp/htdocs/walkpeakdistrict_uk.

I have "C:\xampp\apache\conf\extra\httpd-vhosts.conf" set up as follows:

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

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

And I have "C:\Windows\System32\drivers\etc\hosts" set up as follows:

127.0.0.1   localhost
127.0.0.1   walkpeakdistrict.local

If anyone could offer any insight into this issue I would be very grateful.

Answer

al.tron picture al.tron · Jan 30, 2018

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!