Redirect an old link to new site homepage

I need to redirect a single link www.abc.com/blog/?p=123 to www.abc.com/newblog/

I have used:

Read More
RewriteRule ^blog/(.*)$ http://www.abc.com/newblog/ [R=301,L]

It is redirecting all sorts of links but missing links in the form /?p=1236.

Related posts

Leave a Reply

1 comment

  1. Query arguments are in %{QUERY_STRING}, so you have to look there:

    RewriteCond %{QUERY_STRING} ^p=d+
    RewriteRule ^ http://www.example.com/newblog/ [L,R=301]