Re: [EMAIL PROTECTED] RewriteMap substitutions in RewriteRule

2005-08-15 Thread Tony VanScoy
Thanks for all the help, I've got it working! RewriteEngine On RewriteLog "/var/log/httpd/rewrite_log" RewriteLogLevel 1 RewriteMap fileName prg:/home/trion/getFilename.php RewriteCond %{QUERY_STRING} ^fileId\=(\d+)$ RewriteRule ^/getfile\.php$ /pdf/

Re: [EMAIL PROTECTED] RewriteMap substitutions in RewriteRule

2005-08-12 Thread Joshua Slive
On 8/12/05, Tony VanScoy <[EMAIL PROTECTED]> wrote: > OK, i got my script looping on STDIN, but now I have a problem with > backreferences to the RewriteCond. My condition is this... > > RewriteCond %{QUERY_STRING} ^pdfId\=\d+$ > > .. but thanks to Noah <[EMAIL PROTECTED]> and the manual, i found

Re: [EMAIL PROTECTED] RewriteMap substitutions in RewriteRule

2005-08-12 Thread Tony VanScoy
OK, i got my script looping on STDIN, but now I have a problem with backreferences to the RewriteCond. My condition is this... RewriteCond %{QUERY_STRING} ^pdfId\=\d+$ .. but thanks to Noah <[EMAIL PROTECTED]> and the manual, i found that If I want to use %1 to reference the id being passed then

Re: [EMAIL PROTECTED] RewriteMap substitutions in RewriteRule

2005-08-12 Thread Tony VanScoy
> I'm afraid you may have caugt a slight case of > not-reading-the-documentation-carefully-enough-itis. Unfortunately, > when dealing with mod_rewrite, this affliction can be deadly. > > If you look carefully at the example map program here: > http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

Re: [EMAIL PROTECTED] RewriteMap substitutions in RewriteRule

2005-08-12 Thread Joshua Slive
On 8/12/05, Tony VanScoy <[EMAIL PROTECTED]> wrote: > As a testing purpose I changed my mapping script to this ... > > echo "somefile.php\n"; > ?> > > so no matter what I send, it outputs a filename + newline to stdout. i > didn't have the newline character before, so i restarted the server > an

Re: [EMAIL PROTECTED] RewriteMap substitutions in RewriteRule

2005-08-12 Thread Tony VanScoy
As a testing purpose I changed my mapping script to this ... so no matter what I send, it outputs a filename + newline to stdout. i didn't have the newline character before, so i restarted the server and tested. great, it works. now try the same url again and it doesn't output a filename, just b

Re: [EMAIL PROTECTED] RewriteMap substitutions in RewriteRule

2005-08-12 Thread Joshua Slive
On 8/12/05, Tony VanScoy <[EMAIL PROTECTED]> wrote: > > Additionally, backreferences aren't populated unless the string you want > > to capture is in parentheses. > So I have to use ... > > RewriteCond %{QUERY_STRING} =+"litId=\d+" > > ... instead of ... > > RewriteCond %{QUERY_STRING} ^litId\

Re: [EMAIL PROTECTED] RewriteMap substitutions in RewriteRule

2005-08-12 Thread Tony VanScoy
> > Use %1 for back-references to RewriteCond. $1 is a back-reference to > > the RewriteRule. > > Additionally, backreferences aren't populated unless the string you want > to capture is in parentheses. > > --n > > -- > Neil! Your bed's on fire So I have to use ... RewriteCond %{QUERY_STRING}

Re: [EMAIL PROTECTED] RewriteMap substitutions in RewriteRule

2005-08-12 Thread Joshua Slive
On 8/12/05, Tony VanScoy <[EMAIL PROTECTED]> wrote: > It kind of works. I made the change to %1 and when I made a request ... > > /test.php?pdfId=12 > > .. then it gave me the pdf. SWEET. But, still dies after the first > mapping. If I call that same exact URL again, i get redirected to ... > >

Re: [EMAIL PROTECTED] RewriteMap substitutions in RewriteRule

2005-08-12 Thread Tony VanScoy
On 8/12/05, Joshua Slive <[EMAIL PROTECTED]> wrote: > On 8/12/05, Tony VanScoy <[EMAIL PROTECTED]> wrote: > > First here is my config for a VirtualHost > > > > # map id's to actualy filenames > > RewriteMap fileName prg:/home/user/getFileName.php > > > > # catch any pdfId as long as it's an integer

Re: [EMAIL PROTECTED] RewriteMap substitutions in RewriteRule

2005-08-12 Thread Noah
On Fri, Aug 12, 2005 at 11:28:10AM -0400, Joshua Slive wrote: > On 8/12/05, Tony VanScoy <[EMAIL PROTECTED]> wrote: > > First here is my config for a VirtualHost > > > > # map id's to actualy filenames > > RewriteMap fileName prg:/home/user/getFileName.php > > > > # catch any pdfId as long as it'

Re: [EMAIL PROTECTED] RewriteMap substitutions in RewriteRule

2005-08-12 Thread Joshua Slive
On 8/12/05, Tony VanScoy <[EMAIL PROTECTED]> wrote: > First here is my config for a VirtualHost > > # map id's to actualy filenames > RewriteMap fileName prg:/home/user/getFileName.php > > # catch any pdfId as long as it's an integer > RewriteCond %{QUERY_STRING} ^pdfId\=\d+$ > > # only rewrite

[EMAIL PROTECTED] RewriteMap substitutions in RewriteRule

2005-08-12 Thread Tony VanScoy
First here is my config for a VirtualHost # map id's to actualy filenames RewriteMap fileName prg:/home/user/getFileName.php # catch any pdfId as long as it's an integer RewriteCond %{QUERY_STRING} ^pdfId\=\d+$ # only rewrite for test.php, but substitute the entire URL+QUERY_STRING with the file