use map with Default value under a RewriteRule
1 post
• Page 1 of 1
use map with Default value under a RewriteRule
I try to use the map function with a default value when I don't have any value. I use a variable who can be undefined, when that the case, the map function don't look to work. Is it a way to use a undefined variable with the map function?
${ MapName : LookupKey | DefaultValue }
Source: http://www.helicontech.com/isapi_rewrite/doc/RewriteMap.htm
c:/mapsfiles/LangID.txt
If I pass my optional value &langid=1, everything work as expected
http://www.mydomain.com/index.cfm?arg1=test&arg2=7&arg3=88&langid=1
Result: /newfolder/en/
But If I don't have it. the map function don't work at all.
http://www.mydomain.com/index.cfm?arg1=test&arg2=7
Result : /newfolder/%24%7BlangIDmap:|en%7D/
Expected : /newfolder/en/
Thanks in advance for your help.
${ MapName : LookupKey | DefaultValue }
Source: http://www.helicontech.com/isapi_rewrite/doc/RewriteMap.htm
c:/mapsfiles/LangID.txt
- Code: Select all
1 en
- Code: Select all
RewriteMap langIDmap txt:c:/mapsfiles/LangID.txt
RewriteCond %{QUERY_STRING} ^arg1=test(?:.*&langid=(\d+).*)? [NC]
RewriteRule ^(.*)$ /newfolder/${langIDmap:%1|en}/? [L,R=301]
If I pass my optional value &langid=1, everything work as expected
http://www.mydomain.com/index.cfm?arg1=test&arg2=7&arg3=88&langid=1
Result: /newfolder/en/
But If I don't have it. the map function don't work at all.
http://www.mydomain.com/index.cfm?arg1=test&arg2=7
Result : /newfolder/%24%7BlangIDmap:|en%7D/
Expected : /newfolder/en/
Thanks in advance for your help.
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests