Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 76972 invoked from network); 7 May 2005 23:57:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 May 2005 23:57:45 -0000 Received: (qmail 52974 invoked by uid 500); 8 May 2005 00:00:23 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 52095 invoked by uid 500); 8 May 2005 00:00:20 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 52081 invoked by uid 99); 8 May 2005 00:00:20 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jslive@gmail.com designates 64.233.184.199 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.199) by apache.org (qpsmtpd/0.28) with ESMTP; Sat, 07 May 2005 17:00:20 -0700 Received: by wproxy.gmail.com with SMTP id 67so1601036wri for ; Sat, 07 May 2005 16:57:20 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=dAwbS1hprZ7UhiMkGqiNdkBDWYrPo6IVCWOVOQiIJDdyUYDfhCnS9g2zRqCSycyZVjNnTnGAHEPd6+UWpmvJd6zZxaOHNfIGIwEeLgRcVRURu7S4nleG6peLI3ExoD1s/VqzjlOoDcoOiUIUh5pVO1kRy/o3yQzE6WqYyAAsLGA= Received: by 10.54.8.67 with SMTP id 67mr1640811wrh; Sat, 07 May 2005 16:57:20 -0700 (PDT) Received: by 10.54.62.11 with HTTP; Sat, 7 May 2005 16:57:20 -0700 (PDT) Message-ID: Date: Sat, 7 May 2005 19:57:20 -0400 From: Joshua Slive Reply-To: Joshua Slive To: users@httpd.apache.org In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Virus-Checked: Checked Subject: Re: [users@httpd] invisible CGI invocation X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 5/6/05, Eric S. Johansson wrote: > I'm currently using 404 error handling to achieve this but what I'm > looking to do is invoke multiple CGI programs depending on the base URL > and everything after the base URL is passed to the CGI. For example: >=20 > base URL > http://www.demo.org/ >=20 > anything containing the base URL invokes the CGI program >=20 > http://www.demo.org/foo/rat >=20 > would invokes the base URL associated CGI program and pass the relative > URL /foo/rat to the CGI program. Currently I do this with an error > document hack. Works well just that every reference creates a 404 entry > in the log. >=20 > but if I was to associate a different CGI with a different base URL but > in the same hierarchy: >=20 > http://www.demo.org/alternative/ >=20 > and any URL containing that base invokes the alternative CGI as well as > passing the relative URL to CGI program. >=20 > I'm making it work now with and ErrorDocument handlers but > it does seem like an awful hack. I have tried using index.cgi but > either I'm doing something wrong and it is not being invoked or it isn't > right for this problem. This could be done in various ways, but given the potential complexity, you'll probably want to invest the time to learn mod_rewrite. The basic config you discussed above would look something like: RewriteEngine On RewriteRule ^/alternative(.*) /full/path/to/alternative.cgi$1 [L] RewriteRule ^/(.*) /full/path/to/regular.cgi/$1 A few notes: - You'll probably need to configure those CGIs using AddHandler and Options ExecCGI rather than ScriptAlias. - This will really catch *every* request, including .gif/.jpg/.pdf/etc - You'll surely need to invest time in reading the mod_rewrite docs and investigating the RewriteLog if you want to use this. Joshua. --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org