Reputation: 7152
I want to redirect
http://example.com/report?domain=dollarshaveclub.com
to
http://www.semrush.com/info/dollarshaveclub.com+%28by+organic%29
I've tried:
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^?domain=$
RewriteRule ^report$ http://www.semrush.com/info/$1+%28by+organic%29 [R=301,L]
But I'm not getting anywhere...What could I try next?
Upvotes: 0
Views: 94
Reputation: 7152
Found the solution finally:
RewriteCond %{QUERY_STRING} ^domain=(.*)
RewriteRule ^report(.*) http://www.semrush.com/info/%1+(by+organic)? [R=301,L]
Upvotes: 0
Reputation: 21272
You must remove the R=301,
part.
This works for me:
RewriteEngine On
RewriteRule ^report$ http://www.semrush.com/info/$1+%28by+organic%29 [NC]
Upvotes: 1