httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jos...@slive.ca>
Subject Re: [users@httpd] mod_rewrite niggles
Date Sun, 15 Jan 2006 21:29:28 GMT
On 1/15/06, Benoni Jose <apache@benoni.f2o.org> wrote:
> Hi,
>
> I was having some problems with mod_rewrite and have made a couple of test
> configurations which have isolated the problems I'm having.
>
> The first problem is that each rewrite rule is being repeatidly executed until
> it fails, however I thought it should only execute a rewrite rule once. This
> is causing problems, as I want to change /index.php to /dir/index.php.
> Instead of doing it once it keeps on repeating and then trying to go
> to /dir/dir/dir/dir/dir/dir/dir/index.php. Although I could alter the regex
> to fix this it would make it much cleaner if I could sort the root of the
> problem, as well as clearing up my understanding.
>
> The second problem is that even if I use the flag [L] after a Rewrite rule it
> still executes other rules later on in the .htaccess file.

Both of these problems are caused by the same thing: your request is
going through either an internal redirect (subrequest) or an external
redirect, and this is causing all the rules to be applied again.  We
don't have enough details to figure out why this is happening.  The
RewriteLog would certainly help.

You can tell mod_rewrite not to reprocess rules on internal redirects
using the [NS] flag.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message