htaccess goes round in circles and so do I
-
My blog will not load (the dashboard is OK, however.)
Firefox says:
> The page isn’t redirecting properly
> Firefox has detected that the server is redirecting the request for this address in a way that will never complete.(IE is similar).
The problem is resolved if I edit out one line in my overall root htaccess.
The WP htaccess in /blog reads:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule># END WordPress
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
That overall root htaccess reads:
~~~~~~~~~~~~~~~~~~~~~~~~~
# redirect non-WWW to WWW
RewriteEngine on
RewriteCond %{HTTP_HOST} ^themagicofyou\.co\.uk$ [NC]
RewriteRule ^(.*)$ https://www.themagicofyou.co.uk/$1 [R=301,L]# steers 301s to the index page
redirectMatch 301 ^(.*)/$ https://www.themagicofyou.co.uk$1/index.php(Plus there are dozens of explicit “redirect permanents”.)
~~~~~~~~~~~~~~~~~~~~~~~~~~
The line which causes the problem is this one:
# steers 301s to the index page
redirectMatch 301 ^(.*)/$ https://www.themagicofyou.co.uk$1/index.phpIf I comment this out, the blog loads fine. I have 301’s coming in from an old site, so I do need to steer 301s to the index page.
How do I make the htaccesses play nicely together?
Many thanks
Andy
- The topic ‘htaccess goes round in circles and so do I’ is closed to new replies.