David Emery wrote:
> On Date: Sun, 27 Nov 2005 16:08:50 -0800, "David Christensen" <[EMAIL 
> PROTECTED]> wrote:
> 
>>I'm sure this has been asked before, but I can't seem to find the question or
>>the answer -- how do I direct all incoming requests to a single CGI script on
>>Apache 1.3?
> 
> 
> With mod_rewrite, something like this should do it.
> 
> 
> ---
> 
> RewriteEngine On
> 
> # If you want it to redirect only in the case where there is no real
> # file or directory at the requested location, then un-comment the
> # following two lines 
> ##RewriteCond %{REQUEST_FILENAME} !-f
> ##RewriteCond %{REQUEST_FILENAME} !-d
> 
> RewriteRule ^(.*) myscript.cgi

While this is cool, I'm not sure that it wouldn't cause other problems. For
instance, all bad links etc, would not result in a 404, but rather be redirected
to your script which will then probably emit a 500 error since it's not prepared
to handle a request for /non_existant.gif.

Maybe instead of checking for the existence of the file, maybe you should check
it's type, or extension.

> There might also be a way to do something similar to this without
> mod_rewrite.

You could write a custom perl handler and do the redirection, etc yourself. But
as far as I know, this needs to be done at the apache level (ie, using mod_perl,
mod_rewrite, httpd.conf etc) and can't simply be done at the perl level. So if
you don't have access to the apache running (ie, shared hosting) then you're out
of luck.

-- 
Michael Peters
Developer
Plus Three, LP


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to