httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Weber <mwe...@csksoftware.com>
Subject Re: Apache 1.3.22 gives 302 on mod_rewrite
Date Wed, 28 Nov 2001 09:57:42 GMT
Hi,

> 
> 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}   !^lexi.c-s-k.de [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^/(.*)     http://lexi.c-s-k.de:%{SERVER_PORT}/$1 [L,R]
</IfModule>

That's just like in the guide, right?

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

rewrite_log:
192.168.130.10 - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (2) init rewrite engine with
requested uri /
192.168.130.10 - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (3) applying pattern '^/(.*)' to
uri '/'
192.168.130.10 - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (4) RewriteCond: input='lexi:81'
pattern='!^lexi.c-s-k.de' => matched
192.168.130.10 - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (4) RewriteCond: input='lexi:81'
pattern='!^$' => matched
192.168.130.10 - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (4) RewriteCond: input='81'
pattern='!^80$' => matched
192.168.130.10 - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (2) rewrite / ->
http://lexi.c-s-k.de:81/
192.168.130.10 - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (2) explicitly forcing redirect
with http://lexi.c-s-k.de:81/
192.168.130.10 - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (1) escaping
http://lexi.c-s-k.de:81/ for redirect
192.168.130.10 - - [28/Nov/2001:10:11:02 +0100]
[lexi/sid#f2ac0][rid#11d7c8/initial] (1) redirect to
http://lexi.c-s-k.de:81/ [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:

Trying 192.168.130.4...
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
Location: http://lexi.c-s-k.de:81/
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>302 Found</TITLE>
</HEAD><BODY>
<H1>Found</H1>
The document has moved <A HREF="http://lexi.c-s-k.de:81/">here</A>.<P>
<HR>
<ADDRESS>Apache/1.3.22 Server at lexi.c-s-k.de Port 81</ADDRESS>
</BODY></HTML>
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
websites.
 
> 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...

Marc

---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message