I'm trying to accomplish a routine dynamic to static redirection, but on this particular site it is confounding me.
I want to convert index.php?var=5 to /var-5
This is my what I have in .htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^var\=([0-9]+)$
RewriteRule ^index\.php$ /var-%1 [R=301]
What I get is this: /var-5?var=5
No matter what I try, "?var=5" is appended to the end of the URL. What am I doing wrong?
I want to convert index.php?var=5 to /var-5
This is my what I have in .htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^var\=([0-9]+)$
RewriteRule ^index\.php$ /var-%1 [R=301]
What I get is this: /var-5?var=5
No matter what I try, "?var=5" is appended to the end of the URL. What am I doing wrong?