in reply to Perl script to handle requests to a http://.../path/*
You need mod_rewrite. If you have a stock RH 7.x apache you will have it already. If the fragment presented chokes (because mod_rewrite is not installed) you will need to recompile apache. From memory if you just want mod_rewrite you have to pass these flags to configure:
./configure --enable-module=rewrite --enable-shared=rewrite
As always RTFM. Speaking of which if you want ssl, mod perl and mod_rewrite you will find a good description at http://perl.apache.org/docs/1.0/guide/install.html Note that you don't get the http://www.domain.com bit passed to mod_rewrite just /thedirectory/blah. We implement it like this using a VH container. We had some issues with it outside a VH container, even though the server is a dedicated one (no virtual hosts)
<VirtualHost *> ServerName your.domain.com RewriteEngine on RewriteLog /var/log/httpd/rewrite.log RewriteLogLevel 1 RewriteRule ^/thedirectory(.*)$ http://your.domain.com/cgi-bin/scrip +t.pl?$1 </VirtualHost>
In the rewrite rule we capture the bit after thedirectory in $1 to pass to our script. You can use a full http:// or a partial /cgi-bin rewrite path which will result in the user seeing or not seeing the redirect respectively (also from memory) We use the full path exteernal redirect for reasons that currently elude me ;-)
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perl script to handle requests to a http://.../path/*
by xiper (Friar) on Sep 15, 2003 at 00:33 UTC | |
by tachyon (Chancellor) on Sep 15, 2003 at 02:50 UTC | |
by xiper (Friar) on Sep 15, 2003 at 03:05 UTC |