WordPress redirects to Xampp dashboard except homepage

Is WordPress redirecting all pages except the homepage to the Xampp dashboard? You’ve come to the right place.

I spent so much time looking at the Xampp dashboard page, that I’m almost certain it will be a prominent feature of my next nightmares. Fortunately, you can save time and rest easy, with the help of this guide.

I noticed the issue occurring only when sites are migrated onto the local environment. Initially, I tried using the default WordPress htaccess rules. But this didn’t work, so I went on to try a hundred other things before deciding to get back to where I started.

The solution is to copy the htaccess rules from a site created on localhost and update them to match the site with the issue.

Working htaccess file

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /test1/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /test1/index.php [L]
</IfModule>

# END WordPress

* Heads up * In the above rules, you’ll notice that my directory is called /test1. Make sure to replace that with your own ;).

Default htaccess file (Not working)

# BEGIN WordPress

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

By Mwale Kalenga

A passionate blogger, digital marketer, and website consultant. At the moment I’m using a decade of experience making websites, my bachelor's in business, and various Hubspot certifications to make great content easily accessible.

Leave a comment

Your email address will not be published. Required fields are marked *