-1

I'm using WordPress and this works fine:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

However if I add this before the last line:

RewriteRule "^/iwillnevergetmatched$" "/testfoo" [R=301]

Then in my logs:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://example.org/foo

2
  • 1
    It's not failing due to an "arbitrary Rewrite Rule". It's failing due to too many redirects. Fix your rewrite rules and the issue will go away.
    – EEAA
    Jan 23, 2016 at 1:32
  • @EEAA Indeed, I can read the error message I quoted. What I'm saying is that the RewriteRule I've added doesn't match the URL. That's why I named it iwillnevergetmatched. why is it redirecting when it doesn't match.
    – Kit Sunde
    Jan 23, 2016 at 1:34

1 Answer 1

2

It fails because you're splitting an existing RewriteRule from its preceding conditions. This makes it unconditional, and it loops.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .