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 theDocumentRoot
and change the path there as well.
- Best DevOps is redefining the DevOps landscape - January 28, 2025
- Unlocking the Power of DevOps: How DevOps Consulting Drives Business Success - January 23, 2025
- DevOps Support: Ensuring Seamless Operations and Continuous Improvement - January 23, 2025