xampp always redirect to dashboard

Write a content for .htaccess for all traffic on domain reveieved on http or http://www redirect to https://www

If XAMPP is always redirecting to the dashboard page, it’s likely due to its default configuration settings. When you access http://localhost, XAMPP is configured to redirect to its dashboard or splash page. This behavior is controlled by the Apache configuration files and can be modified if you prefer it to point to another directory or project.

Solution IF YOU HAVE MULTIPLE DOMAIN Hosted at Same Server

$ vi /opt/lampp/htdocs/.htaccess

RewriteEngine On

# Ensure mod_rewrite is enabled
<IfModule mod_rewrite.c>

    # Redirect HTTP to HTTPS with www
    RewriteCond %{HTTPS} off [OR]
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]

</IfModule>

Solution if you have Single Domain

Modify httpd.conf:

  • Open httpd.conf in a text editor.
  • Look for the DocumentRoot directive. It might look like this:apacheCopy codeDocumentRoot "C:/xampp/htdocs"
  • Change the path (C:/xampp/htdocs in the example) to the directory of your choice where your project or website files are located.
  • Similarly, find the <Directory> directive that corresponds to the DocumentRoot and change the path there as well.
rajeshkumar
Latest posts by rajeshkumar (see all)
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x