Home » Php » php – .htaccess redirect conflict wordpress /wp-admin

php – .htaccess redirect conflict wordpress /wp-admin

Posted by: admin February 25, 2020 Leave a comment

Questions:

I will try to be the most specific as I can when I request help in solving this problem, though I don’t have much knowledge about the configuration files used by WordPress here!

The main folder in the website have this code in .htaccess as my objective was to remove .html from pages

RewriteOptions inherit
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{THE_REQUEST} \/index.html\ HTTP [NC]
RewriteRule (.*)index.html$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]

I’ve also installed wordpress to a /blog folder only inside the main folder. Now I can’t access /wp-admin/ (*/blog/wp-admin/), and am receiving an ERR_TOO_MANY_REDIRECTS

How might I correct this?

How to&Answers:

Replace your .htaccess content with this:

RewriteOptions inherit
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule !.*\.html$ %{REQUEST_FILENAME}.html [QSA,L]