Tell me how to redirect from http://site.ru/cat?id=12 to http://othersite.ru/parampampam with htaccess? If you do the usual redirect

#redirect /cat?id=12 http://othersite.ru/parampampam 

then cat? id = 12 is added to the destination address it turns out http://othersite.ru/parampampam?id=12, respectively, we get an error: (

How can I go to http://othersite.ru/parampampam without? Id = 12?

    2 answers 2

    Alternatively, set the status to 301. With it, the parameters are not transmitted.

    • pardon, experimenting with different options for a long time, didn’t correct in the end, wrote / cat? id = 12 doesn’t go at all, apparently the parameter hinders how to go with / cat? id = 12? by redirect - Alexander Kortnev

    Maybe I scored, and even ineptly, nails with a microscope. But another option:

     RewriteCond %{REQUEST_URI} ^/cat$ RewriteCond %{QUERY_STRING} ^id=12$ RewriteRule ^.* http://othersite.ru/parampampam?