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 Wed, 28 Nov 2001 09:57:42 GMT

> On Tue, 27 Nov 2001, Marc Weber wrote:
> > 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...
> It won't loop internally, but it should create a loop between the server
> and client.  It is possible the browser is catching that and refusing to
> go futher.

that would explain it, yes.


> So I say again: start with the one in the guide.  Then give us the details
> about what doesn't work.  It is no use giving us a configuration that
> is obviously broken and asking why it doesn't work.

OK, so here it is:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST}   !^ [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^/(.*){SERVER_PORT}/$1 [L,R]

That's just like in the guide, right?

Now, with Netscape 4.78 "http://lexi:81/"

rewrite_log: - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (2) init rewrite engine with
requested uri / - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (3) applying pattern '^/(.*)' to
uri '/' - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (4) RewriteCond: input='lexi:81'
pattern='!^' => matched - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (4) RewriteCond: input='lexi:81'
pattern='!^$' => matched - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (4) RewriteCond: input='81'
pattern='!^80$' => matched - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (2) rewrite / -> - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (2) explicitly forcing redirect
with - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (1) escaping for redirect - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (1) redirect to [REDIRECT/302]

and in Netscape I see a page with title "302 Found" and text "Found. The
document has moved here."

I try to telnet lexi 81:

Connected to lexi.
Escape character is '^]'.
GET / HTTP/1.0

HTTP/1.1 302 Found
Date: Wed, 28 Nov 2001 09:20:32 GMT
Server: Apache/1.3.22 (Unix) mod_fastcgi/2.2.10
Connection: close
Content-Type: text/html; charset=iso-8859-1

<TITLE>302 Found</TITLE>
The document has moved <A HREF="">here</A>.<P>
<ADDRESS>Apache/1.3.22 Server at Port 81</ADDRESS>
Connection closed by foreign host.

So the header with the "Location" line is sent. So Netscape should be
redirected, but it is not. I tried on several workstations, but it was
the same result  everywhere I tried. I also tried with IE 5.0 on some
NTs, IE doesn't show anything, it's just saying that the page is opened
in the status line, but it never gets there and stops after some time
with "page not available" (which really looks like a loop...).

The entries in the rewrite log are always like the one sample in this
mail. Netscape doesn't seem to be broken, the redirect works on other
> Alternatively, use the other suggestion in the FAQ: simple
> name virtual hosts.

Yes, that could be a solution. Or I go through the fastcgis and change
the path in every one from absolute to relative. But I really would like
to know what's going on and why the redirect doesn't work, though it
seems to be sent and received...


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

View raw message