[users@httpd] RewriteMap substitutions in RewriteRule

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
2) It seems that the mapping only occurs the first time it's called.
Since I don't know if my assumption above is correct, I tried with a
default value for the mapping.
    /pdf/${fileName:$1|somefile.pdf}?
Thats works the first time I call it by redirecting me to
/pdf/somefile.pdf. But the next time I call that same url, i just get
    /pdf/
Maybe my mistakes in the syntax are causing mapping to die for every
request after the first, but i don't know.

Thanks for any input

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux