I’m having a problem in .htaccess, specifically on redirection.
I wanted to rewrite this url:
http://www.domain.com/?mod=country
to
http://www.domain.com/country
I already tried this .htaccess code:
RewriteEngine on
RewriteRule ^\?mod=(.*)$ $1
I tried working on it without the question mark character and it works fine.
I have escaped the question mark because it’s part of the special characters, but still, I couldn’t get it work.
Can you tell what I’m missing?
Directly translating your requirements to rewrite rules:
But you probably want something more flexible like:
These rules apply to the root of your domain.
If you want to do an external redirect add the
Rflag to the rewrite rule.