Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 91748 invoked from network); 14 Jan 2008 15:30:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Jan 2008 15:30:46 -0000 Received: (qmail 50414 invoked by uid 500); 14 Jan 2008 15:30:35 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 50392 invoked by uid 500); 14 Jan 2008 15:30:35 -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 50383 invoked by uid 99); 14 Jan 2008 15:30:35 -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:30:35 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kakibend@gmail.com designates 64.233.182.189 as permitted sender) Received: from [64.233.182.189] (HELO nf-out-0910.google.com) (64.233.182.189) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jan 2008 15:30:11 +0000 Received: by nf-out-0910.google.com with SMTP id c10so148220nfd.24 for ; Mon, 14 Jan 2008 07:30:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=KMm65vzxhUFJoCS+xhnCWRQy0wCer+RgUWHTEOWYUJc=; b=bCBXwm0LjkrNKVUmpDPbPc5YWMUJ/2Vivarc0mUiigqmx5J9XGCVGDfoueYREemRrjdAaxbpSAOyiuPiac230idrAd8lwOkVfNflEZvRm9xfLL3wbYVeKvO2HS8pLA6xny9R/ERvY9imkGRRHo/dQem9VTl9vamvyUpkyOAWlsE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=cDQpo0dWnURziopDIuqQIZ/BNtvxKymqmryZeMMC79/sJnIZdacyPhNMkGN9nmcLZ1siCDB+DzYo3Rk8L3PITp1BI8iuCwNYsxhFHOMhhKJuSGTqmpYR3Z9DmGaespfTARd5eSQBxKcQDAF0vf1f2tEDYP+WNUN9/WLbxid46JQ= Received: by 10.78.133.2 with SMTP id g2mr7441137hud.26.1200324615825; Mon, 14 Jan 2008 07:30:15 -0800 (PST) Received: by 10.78.161.13 with HTTP; Mon, 14 Jan 2008 07:30:15 -0800 (PST) Message-ID: <9dc7421e0801140730s4aa042a0kc68741bda4050b18@mail.gmail.com> Date: Mon, 14 Jan 2008 16:30:15 +0100 From: "karim Bendadda" To: modules-dev@httpd.apache.org Subject: Re: [Apache Module] Request External Redirection In-Reply-To: <20080114150037.GE23798@suse.de> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9635_16333061.1200324615829" References: <9dc7421e0801131158g361df65dpf026b5b05ff915bb@mail.gmail.com> <478B7277.4040909@joe-lewis.com> <9dc7421e0801140650q25f20749p450feaafe529e433@mail.gmail.com> <20080114150037.GE23798@suse.de> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_9635_16333061.1200324615829 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thank you for your help! How can I call the Redirect directive into the module??, In fact in the module I have a function that make an LDAP connection I want to do something like that: request_rec* my_request; //The request with new information if(my_function(user_is_defined_in_ldap)==true) Redirect my_request new_Url else Do_nothing On 1/14/08, Dr. Peter Poeml wrote: > > 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."?? > > > > 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 > doing > > > > 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 = apr_pstrcat(r->pool, baseurl, filename, NULL); > > apr_table_setn(r->headers_out, "Location", uri); > > return HTTP_MOVED_TEMPORARILY; > > Peter > -- > "WARNING: This bug is visible to non-employees. Please be respectful!" > > SUSE LINUX Products GmbH > Research & Development > > -- Karim ------=_Part_9635_16333061.1200324615829--