I have a url:
http://domain.com/i.php?c=PT and I Rewrote it to http://domain.com/PT successfully. But When I browse http://domain.com/i.php?c=PT, it wont redirect to http://domain.com/PT. Is there anyway to both redirect and rewrite it?
My .htaccess:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^c=([a-zA-Z][a-zA-Z])$
RewriteRule ^/index.php$ /%1%2? [R=301,L]
RewriteRule ^([a-zA-Z][a-zA-Z])$ i.php?c=$1$2 [NC,L]
Thanks
Update #1: I want to redirect from domain.com/i.php?c=PT -> domain.com/PT.
I don't have index.php file.
domain.com/PT -> domain.com/i.php?c=PTordomain.com/i.php?c=PT -> domain.com/PT? Are there other URL formats you need to translate? In both cases your rewrite rules are wrong. – ColOfAbRiX Apr 24 '15 at 11:28