I have this rewriterule:
RewriteRule ^authenticate /id/authenticate.php [NS,QSA]
I am getting this error:
[Sat Jul 23 05:12:37 2011] [error] [client 62.178.15.161] 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:
https://2x.to/id/authenticate
I thought the NS flag should prevent this from happening.
Is it not working for some reason, did I not apply it correct or did I misunderstand its purpose?
Is there another way to make this rewriterule “work” without renaming the file?
Edit:
I adapted the RewriteRule to:
RewriteRule ^authenticate$ /id/authenticate.php [QSA]
which works just fine. However I am still interested in why NS didnt work.
You probably want
[L]here, not[NS]—[NS]is specifically for suppressing the rewrite in some unusual situations where Apache will make an “internal” request to itself, like while processing server-side includes.You may also need to make the rule more specific — depending on where this rule is, it’s possible that
^authenticateis matching/id/authenticate.php. If that’s the case, you’ll need to add an earlier rule which “carves out” an exception for that file, like this: