In the following .htaccess, redirecting oldsite.com to newsite.com works fine. But I also want to redirect URLs with parameters from the old site and this does not work:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} ^page_id=4$
RewriteRule http://newsite.com/about/ [QSD,R=301,L]
RewriteCond %{HTTP_HOST} ^oldsite.com$
RewriteRule (.*)$ http://newsite.com/$1 [R=301,L]
</IfModule>
The URL “oldsite.com/?page_id=4” redirects to “newsite.com/?page_id=4” and not to “newsite.com/about/”. The .htaccess file on newsite.com is the usual WordPress with nothing added. What am I doing wrong?