Apache virtual host always redirecting to /dashboard
Solution 1
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!
Solution 2
This happened with me as well. And I resolved it. In my case, it was happening because of the SSL module. So, turning it off got me out of the trouble. Just Open the httpd.conf file and comment the SSL include code by adding # to the front of the code as given below.
# Secure (SSL/TLS) connections
# Include conf/extra/httpd-ssl.conf
After this, it will be resolved.
Solution 3
I'm pretty sure the issue for me had to do with SSL redirects, for some reason. When I edited my .htaccess to exclude local.mydomain.com when forcing https, I stopped getting redirected to the XAMPP dashboard.
Below is the section of my .htaccess that excludes local sites from redirecting to https. You can add extra RewriteCond
lines for other local domains.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !=localhost
RewriteCond %{HTTP_HOST} !local\.
RewriteCond %{HTTP_HOST} !other.localdomain.example.com
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L]
</IfModule>
<IfModule mod_headers.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !local\.
RewriteCond %{HTTP_HOST} !other.localdomain.example.com
Header set Strict-Transport-Security "max-age=16070400" env=HTTPS
</IfModule>
Related videos on Youtube
al.tron
Updated on June 23, 2022Comments
-
al.tron almost 2 years
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.
-
Leandro Bardelli about 5 yearsThis is not what the OP ask
-
TheVic over 4 yearsOMG, i was fighting with this two days. Thank you. Now I lefted it without any .COM or .DEV or .LOCAL and it work perfect.
-
Ahmed Syed over 3 yearsThanx @al.tron I spent 10 hours figuring out why virtualhost getting redirected to xampp dashboard when server name was set to site.local, but when I changed it to site.localhost it worked perfectly.
-
Damian over 3 yearswhere is this file located?
-
cliambrown over 3 years@Damian Here's some info for you! danielmorell.com/guides/htaccess-seo/basics/…
-
SamIAm almost 3 yearsI just encountered this in 2021... >.< Still not sure why this is happening.
-
Jenuel Ganawed almost 3 yearshow did you do it?
-
Kaustubh Bagwe over 2 yearsthat worked for me, in new projects the virtual host was working but the older ones which were unused for a long time there this problem of redirecting to xampp dashboard was occurring
-
Stanley Aloh over 2 yearsThis worked for me. SSL redirect was the problem