0

I have url http://www.somepage.com?value%5b%5d=0_13240 , when i try to use RedirectPermanent, it is not working.

RedirectMatch 301 http://www.somepage.com?value%5b%5d=0_13240 http://www.somepage.com/newpage.php

i know that is query string in url problem, but i dont know how to write in .htaccess

i tried solutions from here, but nobody uses query in string: .htaccess 301 redirect of single page

Community
  • 1
  • 1
gandrap
  • 139
  • 1
  • 11

1 Answers1

0

You cannot match QUERY_STRING using RedirectMatch directive. Use mod_rewrite rules instead:

RewriteEngine On

RewriteCond %{QUERY_STRING} ^value[]=0_13240$
RewriteRule ^/?$ /newpage.php? [L,R=301]
anubhava
  • 761,203
  • 64
  • 569
  • 643