Reputation: 141
I am stuck with apache redirects. I need to redirect https://sitename.com/index.php?q=news to https://sitename.com/news, I use
RewriteEngine on
RewriteCond %{QUERY_STRING} ^q=(.*)$
RewriteRule https://sitename.com/%1? [R=301,L]
But nothing happens
Upvotes: 1
Views: 60
Reputation: 7476
Try below rule, I am assuming you have handler for it.
RewriteEngine on
RewriteCond %{QUERY_STRING} ^q=(.*)$
RewriteRule ^ https://sitename.com/%1? [R=301,L]
Upvotes: 2