httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Krist van Besien" <>
Subject Re: [users@httpd] Problems with RewriteRule in .htaccess
Date Fri, 28 Nov 2008 12:18:48 GMT
On Fri, Nov 28, 2008 at 1:02 PM, Andrew Connick
<> wrote:

> Also, as it stands, I get an internal server error, which I can fix by
> uncommenting #RewriteRule  ROOT/ - [L]  but why is this line needed ?

You problem is due to the way RewriteRules are processed in a
.htaccess file  context. RewriteRules in a .htaccess file  context are
only applied after Apache has found out what file to serve, because
that is when .htaccess files are read. If the rules change the URL
apache will restart the request, because the change could mean it now
has to read another .htaccess file...
This can lead to loops, which lead to internal server errors.
In your case apache will, after rewriting foo.html to ROOT/foo.html,
restart the requests and this causes a  rewrite to ROOT/ROOT/foo.html,
which causes a restart of the request which causes a rewrite until
some limit gets reached and a server error will be logged.
The rule you need to add breaks this loop:
RewriteRule  ROOT/ - [L


Bremgarten b. Bern, Switzerland
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message