I'm working with apache mod_rewrite that suppots perl regex. How can I use question mark as a normal char? for example:
RewriteCond %{REQUEST_URI} ^(/.*/service/City?name)=(.*)-(.*)$
I'm working with apache mod_rewrite that suppots perl regex. How can I use question mark as a normal char? for example:
RewriteCond %{REQUEST_URI} ^(/.*/service/City?name)=(.*)-(.*)$
You don't match query string using RewriteCond %{REQUEST_URI}
. You will need to use QUERY_STRING
variable for that. So correct way will be this:
RewriteCond %{QUERY_STRING} ^name=(.*)-(.*)$
RewriteCond %{REQUEST_URI} ^(/.*/service/City)$
you can also have a look here :
Match Question Mark in mod_rewrite rule regex
since you are working with mod_rewrite you might want to hide your ? completely. The post above will explain how to do that.