Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 18309 invoked from network); 29 Oct 2007 19:32:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Oct 2007 19:32:08 -0000 Received: (qmail 65105 invoked by uid 500); 29 Oct 2007 19:31:56 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 64799 invoked by uid 500); 29 Oct 2007 19:31:55 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 64790 invoked by uid 99); 29 Oct 2007 19:31:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Oct 2007 12:31:55 -0700 X-ASF-Spam-Status: No, hits=1.8 required=10.0 tests=DATE_IN_PAST_12_24,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.151.18.208] (HELO dedi17.smart-servers.de) (83.151.18.208) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Oct 2007 19:31:57 +0000 Received: from xdsl-87-78-45-176.netcologne.de ([87.78.45.176] helo=dilbert.crrrwg.de ident=foobar) by dedi17.smart-servers.de with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1ImaFB-0005fB-Tw for modules-dev@httpd.apache.org; Mon, 29 Oct 2007 20:25:50 +0100 Received: from asus.crrrwg.de ([192.168.201.92] ident=ff13205381c200d083e5f30821d6a6fa) by dilbert.crrrwg.de with esmtp (Exim 4.63) (envelope-from ) id 1ImaKk-0002Ce-0c for modules-dev@httpd.apache.org; Mon, 29 Oct 2007 20:31:34 +0100 Subject: Re: rewriting request uri in a request handler From: Joachim Zobel Reply-To: jzobel@heute-morgen.de To: modules-dev@httpd.apache.org In-Reply-To: <471F169F.6050502@artofdefence.com> References: <471F169F.6050502@artofdefence.com> Content-Type: text/plain Organization: Not organized Date: Mon, 29 Oct 2007 08:11:47 +0100 Message-Id: <1193641907.4712.9.camel@test.asus> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 Content-Transfer-Encoding: 7bit X-SA-Do-Not-Run: Yes X-SA-Exim-Connect-IP: 87.78.45.176 X-SA-Exim-Rcpt-To: modules-dev@httpd.apache.org X-SA-Exim-Mail-From: jzobel@heute-morgen.de X-SA-Exim-Scanned: No (on dedi17.smart-servers.de); SAEximRunCond expanded to false X-Virus-Checked: Checked by ClamAV on apache.org Am Mittwoch, den 24.10.2007, 11:55 +0200 schrieb Holger Moser: > I have a question regarding request uri rewriting in an > request_handler, > right now i do this by overwriting the "request_rec->uri" element > which > works but leads to a second > call of my request handler (it seems that apache recognizes the change > and fires a new request with the rewritten uri) This is because the fact that you are in a request handler means that URL translation has already been done. If you change the URI, it needs to be redone including all subsequent phases like authentication. > which wouldnt be a > problem if i could distinguish if its a request from a rewrite or a > "normal" one (and skip the handler if its a rewritten). The request can be distiguished. The second request is what is called an internal redirect (and a subrequest) and there are ways to detect this. I have only done this from mod_perl, there are $r->prev and the like. I would however recommend using Joe Lewis proposal, since you may want your module to be usable in internal redirects in the future. However I am not 100% shure if the sub process enviroment survives an internal redirect. Sincerely, Joachim