Simple 301 redirect; how do I get it to drop the query string?

Posted by Throlkim on Stack Overflow See other posts from Stack Overflow or by Throlkim
Published on 2010-05-12T08:41:16Z Indexed on 2010/05/12 8:44 UTC
Read the original article Hit count: 248

Hopefully there's a simple solution to this. I'm setting up a redirect for old search listings, but I don't want any of the query string to carry over.

The current rule is:

redirect 301 /blog http://newdomain.com

But this would redirect the following:

http://www.olddomain.com/blog/2009/11/article-name-etc

To this:

http://newdomain.com/2009/11/article-name-etc

When I just want:

http://newdomain.com

Can this be done in the simple 301 redirect, or will I have to write a mod_rewrite rule?

© Stack Overflow or respective owner

Related posts about .htaccess

Related posts about apache