avir
asked on
isapi rewrite and map file not working
I don't seem to be able to get this question answered, but I'll try again.
I am playing around with isapi rewrite lite with only limited success. I'm trying to substitute the url querystring parameter with it's value. I have gotten it work, but I can't seem to be able to implement a parameter substitution using a map file. I'm working in classic ASP on Windows 2003 with isapi version 3.
In my httpd.conf file this works:
RewriteCond %{QUERY_STRING} ^cy=(\d+)$ [NC]
RewriteRule ^imagine/ketubot/$ imagine/ketubot/%1? [NC,R=301,L]
RewriteRule ^imagine/ketubot/(\d+)$ imagine/ketubot/?cy=$1 [NC,L]
and I get a url like /imagine/ketubot/5 in place of /imagine/ketubot/?cy=5
This doesn't work:
RewriteMap mapfile txt:mapcountries.txt [NC]
RewriteRule ^imagine/ketubot/(\d+)$ imagine/ketubot/?cy=${mapf ile:$1}
and it remains with /imagine/ketubot/?cy=5
instead of what I hoped to get: /imagine/ketubot/Algeria
I would appreciate any help with this. Thanks
I am playing around with isapi rewrite lite with only limited success. I'm trying to substitute the url querystring parameter with it's value. I have gotten it work, but I can't seem to be able to implement a parameter substitution using a map file. I'm working in classic ASP on Windows 2003 with isapi version 3.
In my httpd.conf file this works:
RewriteCond %{QUERY_STRING} ^cy=(\d+)$ [NC]
RewriteRule ^imagine/ketubot/$ imagine/ketubot/%1? [NC,R=301,L]
RewriteRule ^imagine/ketubot/(\d+)$ imagine/ketubot/?cy=$1 [NC,L]
and I get a url like /imagine/ketubot/5 in place of /imagine/ketubot/?cy=5
This doesn't work:
RewriteMap mapfile txt:mapcountries.txt [NC]
RewriteRule ^imagine/ketubot/(\d+)$ imagine/ketubot/?cy=${mapf
and it remains with /imagine/ketubot/?cy=5
instead of what I hoped to get: /imagine/ketubot/Algeria
I would appreciate any help with this. Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
good to see you have a solution. best of luck!
avir, for fun, experiment with the [NC] on the mapfile values. See if nocase does not matter.
ASKER
Doesn't seem to make a difference one way or another. I removed the [NC] and changed the values to with and without uppercase and it doesn't seem to matter. It still works. Unless I'm not understanding what [NC] means.
Thanks, i was interested in the results. :)
ASKER
I searched and found a comprehensive solution to my problem on the Helicon forum.
RewriteRule ^/imagine/ketubot/(\d+)$ /imagine/ketubot/?cy=${map
-- I just cant remember.