httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noah <s...@onastick.net>
Subject Re: [users@httpd] RewriteMap substitutions in RewriteRule
Date Fri, 12 Aug 2005 15:37:24 GMT
On Fri, Aug 12, 2005 at 11:28:10AM -0400, Joshua Slive wrote:
> On 8/12/05, Tony VanScoy <tvanscoy@gmail.com> 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 for test.php, but substitute the entire
> > URL+QUERY_STRING with the file location
> > RewriteRule ^/test\.php$ /pdf/${fileName:$1}? [R,L]
> > 
> > 
> > That does not work. I'm very new to this.
> > 
> > 1) I'm assuming that $1 in RewriteRule represents the \d+ in the
> > RewriteMap. Please correct me if I'm wrong.
> 
> 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!

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message