0

I have a little bit of trouble with a redirect

I'd like to redirect every incoming traffic from

http://domain.com/?friends=7 to http://domain.com/win

I am using this rule, but it does not seem to work.

RewriteRule ^\?friends\=7$ /win [R=301]
Mike Rockétt
  • 8,947
  • 4
  • 45
  • 81
Tobi
  • 19
  • 1
  • 5

1 Answers1

1

You can't catch a query string with a RewriteRule you need to use a RewriteCond for this task:

RewriteBase /
RewriteCond %{QUERY_STRING} ^friends=7$
RewriteRule ^$ /win? [L,R=301]

You can test your RewriteRule using this tool

Amit Verma
  • 40,709
  • 21
  • 93
  • 115
Florian Lemaitre
  • 5,905
  • 2
  • 21
  • 44