Forum Moderators: phranque

Message Too Old, No Replies

All requests to a single program?

         

Brett_Tabke

9:10 pm on Jul 12, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



What if I want to by pass apache entirely and dice the urls myself?

What is the easiest way to dump every url request made, into program?

eg:
/foo/
/fun/
/bob?goforit.cgi=foo
/index.htm

I want every url request handled by one program.

as always with apache - this seems like something simple to do, yet I can't quite wrap my brain around the syntax.

jdMorgan

10:56 pm on Jul 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Generally, that could be accomplisehd with:

RewriteCond %{REQUEST_URI} !^/cgi-bin/v4_1.pl
RewriteRule .* /cgi-bin/v4_1.pl [L]

I'd recommend exclusions for images, robots.txt, critical error-handling pages (to reduce dependencies in case there are any problems -current or future- with the script), and maybe a few other 'special' files.

Jim

[edited by: jdMorgan at 10:57 pm (utc) on July 12, 2006]

Brett_Tabke

11:11 pm on Jul 12, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I was trying to figure out an easier way of doing it directly from the conf file and by passing mod rewrite alltogether.

jdMorgan

11:39 pm on Jul 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't think there's any way to change the URL-to-filename translation without using mod_rewrite, unless you want to code up your own mini-module in 'C' -- You could get the mod_rewrite source from Apache.org and strip it down to perform a fixed internal rewrite -- basically, rip out everything but the API hooks and a fixed-format call to same.

I also want to re-emphasize that 500-Server Error handling should (almost *must*) be done outside of the main script; Otherwise, any script error will re-invoke the script, potentially cause another error, etc. This could potentially get very nasty -- Sort of a 'fast-burn meltdown'.

Jim