1

I created few redirect conditions but only one among all doesn't work:

Redirect 301 /testy.html?task=quiz&quizId=1 /testy-egzaminacyjne/egzaminy-na-pozwolenie-na-bron.html

It's probably because first (old) URL uses ? = & ... but I can't figure out how it should be changed correctly.

Sulibrat
  • 51
  • 1
  • 4
  • possible duplicate of [How to redirect URLs based on query string?](http://stackoverflow.com/questions/13073253/how-to-redirect-urls-based-on-query-string) – showdev Jan 21 '15 at 21:14

1 Answers1

0

You cannot match query string using Redirect directive. Use mod_rewrite instead.

You can use this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

RewriteCond %{QUERY_STRING} ^task=quiz&quizId=1$ [NC]
RewriteRule ^testy\.html$ /testy-egzaminacyjne/egzaminy-na-pozwolenie-na-bron.html? [L,R=301]
anubhava
  • 761,203
  • 64
  • 569
  • 643
  • My redirect rule was created using: http://www.htaccessredirect.net/ . I created about 12 similar rules and all of them works... only above doesn't. I'll give a try to your solution. – Sulibrat Jan 22 '15 at 20:37