Return-Path: Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Delivered-To: mailing list users@httpd.apache.org Received: (qmail 58570 invoked from network); 27 Nov 2001 17:27:12 -0000 Received: from mail.c-s-k.de (HELO kepler.csksoftware.de) (62.96.245.74) by daedalus.apache.org with SMTP; 27 Nov 2001 17:27:12 -0000 Sender: mweber@csksoftware.com Message-ID: <3C03CCEB.D09A0508@csksoftware.com> Date: Tue, 27 Nov 2001 18:27:07 +0100 From: Marc Weber Organization: CSK Software AG X-Mailer: Mozilla 4.78 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: users@httpd.apache.org Subject: Re: Apache 1.3.22 gives 302 on mod_rewrite References: <3C03B995.2818E9E@csksoftware.com> <3C03BCC4.F7D3A4E9@bourse.ch> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS snapshot-20010407 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hello, sorry for not being precise enough. > [..] > > I'm afraid I don't understand your question. Do you have two webservers > on the same machine (1.3.6 on port 80 and 13.22 on post 81)? That's right. I try to replace the 1.3.6 with the 1.3.22. I compiled the 1.3.22 from source on the same machine it is running on now on port 81. > > Please try to think through your problem again and re-post. State > concisely: > - what you want to happen The server has several DNS-entrys and can be called without it's FQDN as http://server instead of http://server.ourdomain.com. There are several fastcgis running where scripts point to the FQDN and don't work if you call them by http://server, so I want to redirect any request to the server to http://server.ourdomain.com. > - what is actually happening The request to http://server redirects me to http://server.ourdomain.com, problem is, I don't get redirected to index.html (index.html exists and is DirectoryIndex). In the browser, I just see a page with a headline of "302 found" and on the page itself "Found. The document has moved here." where the "here" is a link to this same page. > - what directives you think are important Only thing that seems to change anything is _where_ I point the redirect to. If I'm using: RewriteRule ^/(.+) http://server.ourdomain.com:80/$1 [R,L] (pointing to the 1.3.6 on port 80), I'm redirected exactly to the page I requested. That means, I ask for "http://server:81/example.html" I get "http://server.ourdomain.com:80/example.html". If I change the rewrite rule to: RewriteRule ^/(.+) http://server.ourdomain.com:81/$1 [R,L] (now pointing to the 1.3.22 on port 81, that is, to itself) and ask for "http://server/example.html", in the status line of the browser I see "http://server.ourdomain.com:81/example.html", but don't get the page I requested but the "302"-page I described before. > > Please don't say "it works/it doesn't work" - describe what appears in > the browser and list what it says in the access_log and error_log. > Sorry, forgot that: In the first case (redirecting to 1.3.6:80) no entry in error_log and access_log. In rewrite_log (level 9): 192.168.130.10 - - [27/Nov/2001:18:09:47 +0100] [server/sid#f22e0][rid#11cfe8/initial] (2) init rewrite engine with requested uri / 192.168.130.10 - - [27/Nov/2001:18:09:47 +0100] [server/sid#f22e0][rid#11cfe8/initial] (3) applying pattern '^/(.+)' to uri '/' 192.168.130.10 - - [27/Nov/2001:18:09:47 +0100] [server/sid#f22e0][rid#11cfe8/initial] (1) pass through / 192.168.130.10 - - [27/Nov/2001:18:09:47 +0100] [server/sid#f22e0][rid#11f000/subreq] (2) init rewrite engine with requested uri /index.html 192.168.130.10 - - [27/Nov/2001:18:09:47 +0100] [server/sid#f22e0][rid#11f000/subreq] (1) pass through /index.html 192.168.130.10 - - [27/Nov/2001:18:09:47 +0100] [server/sid#f22e0][rid#11dd70/initial/redir#1] (2) init rewrite engine with requested uri /index.html 192.168.130.10 - - [27/Nov/2001:18:09:47 +0100] [server/sid#f22e0][rid#11dd70/initial/redir#1] (3) applying pattern '^/(.+)' to uri '/index.html' 192.168.130.10 - - [27/Nov/2001:18:09:47 +0100] [server/sid#f22e0][rid#11dd70/initial/redir#1] (2) rewrite /index.html -> http://server.ourdomain.com:80/index.html 192.168.130.10 - - [27/Nov/2001:18:09:47 +0100] [server/sid#f22e0][rid#11dd70/initial/redir#1] (2) explicitly forcing redirect with http://server.ourdomain.com:80/index.html 192.168.130.10 - - [27/Nov/2001:18:09:47 +0100] [server/sid#f22e0][rid#11dd70/initial/redir#1] (1) escaping http://server.ourdomain.com:80/index.html for redirect 192.168.130.10 - - [27/Nov/2001:18:09:47 +0100] [server/sid#f22e0][rid#11dd70/initial/redir#1] (1) redirect to http://server.ourdomain.com:80/index.html [REDIRECT/302] In the second case (redirecting to 1.3.22:81) no entry in error_log, entry in access_log: 192.168.130.10 - - [27/Nov/2001:18:17:10 +0100] "GET / HTTP/1.0" 302 275 192.168.130.10 - - [27/Nov/2001:18:17:10 +0100] "GET /index.html HTTP/1.0" 302 284 in rewrite_log: 192.168.130.10 - - [27/Nov/2001:18:17:10 +0100] [server.ourdomain.com/sid#f22e0][rid#11cfe8/initial] (2) init rewrite engine with requested uri /index.html 192.168.130.10 - - [27/Nov/2001:18:17:10 +0100] [server.ourdomain.com/sid#f22e0][rid#11cfe8/initial] (3) applying pattern '^/(.+)' to uri '/index.html' 192.168.130.10 - - [27/Nov/2001:18:17:10 +0100] [server.ourdomain.com/sid#f22e0][rid#11cfe8/initial] (2) rewrite /index.html -> http://server.ourdomain.com:81/index.html 192.168.130.10 - - [27/Nov/2001:18:17:10 +0100] [server.ourdomain.com/sid#f22e0][rid#11cfe8/initial] (2) explicitly forcing redirect with http://server.ourdomain.com:81/index.html 192.168.130.10 - - [27/Nov/2001:18:17:10 +0100] [server.ourdomain.com/sid#f22e0][rid#11cfe8/initial] (1) escaping http://server.ourdomain.com:81/index.html for redirect 192.168.130.10 - - [27/Nov/2001:18:17:10 +0100] [server.ourdomain.com/sid#f22e0][rid#11cfe8/initial] (1) redirect to http://server.ourdomain.com:81/index.html [REDIRECT/302] Both cases were generated with the same request, "http://server:81/". First request showed me the index.html, the second the "302"-page. Thanks for your help so far! Marc