in reply to Odd CGI interception

don't ask why, consider it a client requirement

For the benefit of the curious, this is usually done to fool search engines into indexing your scripts. I worked at a car auction website for a while, and they had it work like /Cars/34343/ rather than cars.cgi?34343 so that each car would be indexed. (And I did it with Apache at the time, but I've long since forgotten how I did it)

Replies are listed 'Best First'.
Re: Re: Odd CGI interception
by a (Friar) on Jan 12, 2001 at 10:57 UTC
    You can, in apache, ScriptAlias a dir to a cgi-bin script, so:
    ScriptAlias /rats/ /web/cgi-bin/run_rats.cgi
    http://www.duo.com/rats/
    runs run_rats.cgi (this seems wrong and the docs show it for dirs only, but I've seen the dang thing work, though I don't have access to the server). But, w/ the proper aliasing (see the scriptaliasmatch directive too) and path_info you should be able to get any script run on the rest of the line. Once apache finds an executable in the path, it executes that and passes the rest of the request in as $ENV{PATH_INFO}

    a

      You probably want that to be
      ScriptAlias /rats/ /web/cgi-bin/run_rats.cgi/
      Note the final slash. Otherwise, /rats/foo will try to invoke run_rats.cgifoo, and you probably don't a have a file with that name.

      -- Randal L. Schwartz, Perl hacker