Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 7786 invoked from network); 14 Jan 2008 15:01:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Jan 2008 15:01:10 -0000 Received: (qmail 67886 invoked by uid 500); 14 Jan 2008 15:01:00 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 67573 invoked by uid 500); 14 Jan 2008 15:00:59 -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 67564 invoked by uid 99); 14 Jan 2008 15:00:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jan 2008 07:00:59 -0800 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [195.135.220.15] (HELO mx2.suse.de) (195.135.220.15) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jan 2008 15:00:33 +0000 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 4BCFD30122 for ; Mon, 14 Jan 2008 16:00:37 +0100 (CET) Date: Mon, 14 Jan 2008 16:00:37 +0100 From: "Dr. Peter Poeml" To: modules-dev@httpd.apache.org Subject: Re: [Apache Module] Request External Redirection Message-ID: <20080114150037.GE23798@suse.de> Mail-Followup-To: modules-dev@httpd.apache.org References: <9dc7421e0801131158g361df65dpf026b5b05ff915bb@mail.gmail.com> <478B7277.4040909@joe-lewis.com> <9dc7421e0801140650q25f20749p450feaafe529e433@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2JFBq9zoW8cOFH7v" Content-Disposition: inline In-Reply-To: <9dc7421e0801140650q25f20749p450feaafe529e433@mail.gmail.com> X-Useless-Header: If you read this, say 'honk'! User-Agent: Mutt/1.5.13 (2006-08-11) Sender: Peter Poeml X-Virus-Checked: Checked by ClamAV on apache.org --2JFBq9zoW8cOFH7v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 14, 2008 at 03:50:25PM +0100, karim Bendadda wrote: > Thanks for your answer! But I don't understand the second way to implement > it?? "it can respond with a Location: header and a status of 302."?? >=20 > On 1/14/08, Joe Lewis wrote: > > > > karim Bendadda wrote: > > > I'm writing a module (MyModule_mod.c) wich has an *HTTP > > request* as > > > input . I want to add an information to the request (an integer) and > > > redirect it to an *external *server ...Did you know any method for do= ing > > > this? > > > > > > > > > > There are two paths. The server can PROXY to the external server (e.g. > > grab the result from the external server and then relay that to the > > client) or it can respond with a Location: header and a status of 302. > > Figure out which you wanted to do, and if you struggle to implement it, > > let us know. In your handler, you would do something like this to implement the latter: /* set a "Location:" header and 302 redirect. */ /* assemble the url by appending the filename to a baseurl */ uri =3D apr_pstrcat(r->pool, baseurl, filename, NULL); apr_table_setn(r->headers_out, "Location", uri); return HTTP_MOVED_TEMPORARILY; Peter --=20 "WARNING: This bug is visible to non-employees. Please be respectful!" =20 SUSE LINUX Products GmbH Research & Development --2JFBq9zoW8cOFH7v Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFHi3kV92K4Je+2lOoRAmniAJ4hFDIhmUl0LTw7kd6U5aSTssm7zwCcDCSQ MXI5lRt9j/Q4wMf250/6XTs= =xQ8O -----END PGP SIGNATURE----- --2JFBq9zoW8cOFH7v--