I discovered on my local system when first testing Drupal 7 that I was running into too many redirects when trying to access clean URLs.
I found this was due to the main rewrite rule in the way it references index.php. It references it relative to the requested path instead of the site root:
RewriteRule ^ index.php [L]
I resolved the problem by simply adding a preceding slash to it as follows:
RewriteRule ^ /index.php [L]
If the preceding slash is missing, then let's say you request the clean URL http://www.example.com/admin/config it would rewrite that URL to http://www.example.com/admin/config/index.php. That file doesn't exist, so apache runs it through the rewrite rule again, ad infinitum thus hitting the apache redirect limit.
Comments
Comment #1
teknocat CreditAttribution: teknocat commentedRelates to: #951042: Clean URLs not working with default .htaccess
Comment #2
neRok CreditAttribution: neRok commentedMarked #1931680: Clean URL's: Change RewriteRule ^ index.php [L] to RewriteRule ^ /index.php [L] as duplicate of this issue.
Comment #4
Anybody@teknocat I guess you forgot to comment out
RewriteBase
?Closing this outdated after > 10 years :)