I have a RewriteCond
that checks if {QUERY_STRING}
contains the right version number, if it doesn't then redirect users to the correct version.
For instance if v0.7 is the latest, users accessing http://localhost/?v=0.5
should be redirected to http://localhost/?v=0.7
but for some reason, if am using RewriteMap
in the conditions, it doesn't work...
This works
RewriteMap versions txt:/var/www/html/version.txt
RewriteCond "%{QUERY_STRING}" !^v=0.7
RewriteRule "^/$" "/?v=${versions:version}" [R,L]
This doesn't
RewriteMap versions txt:/var/www/html/version.txt
RewriteCond "%{QUERY_STRING}" !^v=${versions:version}
RewriteRule "^/$" "/?v=${versions:version}" [R,L]
Content of version.txt
##
## version.txt -- rewriting map
## The version number written here will be mapped to the URL
##
##
version 0.7