.htaccess 301 redirect from /?p=blahblahblah

I am trying to set up 301 redirects in the .htaccess file of a site that I converted to WordPress.

The old site had URLs that looked like the following

http://www.example.com/?p=about
http://www.example.com/?p=contact-us

The Rewrite rules I have tried are below, but none work.

Redirect 301 /?p=about /about/
Redirect 301 /?p=contact-us /contact-us/

Redirect 301 /?p=about http://www.example.com/about/
Redirect 301 /?p=contact-us http://www.example.com/contact-us/

Redirect 301 /?p=about /about/
Redirect 301 /?p=contact-us /contact-us/

Redirect 301 /?p=about http://www.example.com/about/
Redirect 301 /?p=contact-us http://www.example.com/contact-us/

It seems as if the WordPress rewrite rules are kicking in first, even though I have the 301 Redirect’s above the WordPress redirect rules. The page that is displayed is the blog roll page which displays “Nothing Found” because I have no posts.

Is there a way I can make these redirects work?

Read more here: .htaccess 301 redirect from /?p=blahblahblah

Leave a Reply

Your email address will not be published. Required fields are marked *