httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Weber <>
Subject Re: Apache 1.3.22 gives 302 on mod_rewrite
Date Tue, 27 Nov 2001 19:23:24 GMT

> I haven't looked at the logs you posted, but the configuration you sent
> did not look anything like either of the two options listed in the FAQ.
> If you are going to use the RewriteRule version you will absolutely need a
> RewriteCond on the HTTP_HOST to prevent looping.  It will never work
> otherwise.

it was a good idea with the looping. I tried a rule that will loop, just
to see what it looks like in the browser & logs.

The rule I tried is 

RewriteRule ^(.*)$1      [R]

and that one loops for sure. It recursively adds slashes to the request,
so the log ends up with something like - - [27/Nov/2001:18:57:20 +0100]
[][rid#11cfe8/initial] (2) rewrite
//////////////////////////////////////////////////////////////////////////////////////////////////////////////index.html seems not even to break at a length of 255.

The following I'm not completely sure of, so please s.o. correct me, if
I'm wrong:

The example in the faq is ^/(.*), which would loop too, if it wasn't
caught somewhere. That's what Joshua pointed out, and I agree
completely. Since I removed the conditions mentioned in the faq and 

RewriteRule ^/(.*)$1      [R,L]

invoked with http://server:81/ gives in the rewrite log - - [27/Nov/2001:20:00:57 +0100]
[][rid#11cfe8/initial] (2) init rewrite
engine with requested uri /index.html - - [27/Nov/2001:20:00:57 +0100]
[][rid#11cfe8/initial] (3) applying
pattern '^/(.+)' to uri '/index.html' - - [27/Nov/2001:20:00:57 +0100]
[][rid#11cfe8/initial] (2) rewrite
/index.html -> - - [27/Nov/2001:20:00:57 +0100]
[][rid#11cfe8/initial] (2) explicitly
forcing redirect with - - [27/Nov/2001:20:00:57 +0100]
[][rid#11cfe8/initial] (1) escaping for redirect - - [27/Nov/2001:20:00:57 +0100]
[][rid#11cfe8/initial] (1) redirect to [REDIRECT/302]

which doesn't look like a loop for me, couldn't it be that the "L"
catches? Kind of remembering state? I'm just guessing here, really...

> Why don't you start again with one of the options in the FAQ and let us
> know what problems you find if any.

I *started* from there. I got the result I described. I checked,
double-checked & re-checked to make sure I'm correct with the regex and
the server-names. Same result. Then I started to remove conditions. Same
result. I started over from the beginning, same result. I said "I read
the faq" because I *did* read the faq, the mod_rewrite Rewriting Guide
and Ralf Engelschalls Rewriting Guide and not because it's the most
convenient thing to say.

This isn't even the first time I set up Apache with mod_rewrite, and I
never had any problems with it.

Are there known issues with Netscape failing redirection? I know IE does
behave strange in this respect sometimes, but I don't remember about

Well, thanks for all the help so far...


View raw message