Mod_Rewrite: Testing URL got indexed in Google - How do I create a proper 301 redirect?

Posted by Jonathan Wold on Stack Overflow See other posts from Stack Overflow or by Jonathan Wold
Published on 2010-06-16T16:19:33Z Indexed on 2010/06/16 16:22 UTC
Read the original article Hit count: 261

Filed under:
|
|
|
|

I worked on a website for which I had a "development URL" that looked something like this:

www.domainname.com.php5-9.dfw1-2.websitetestlink.com/

Now, several weeks after the website launch, there is at least one page of content indexed on Google with that URL.

Question: How do I redirect all requests from that test URL to reroute to the actual domain?

So, for instance, I would want:

www.domainname.com.php5-9.dfw1-2.websitetestlink.com/page-name

To go to:

www.domainname.com/page-name

The website is powered by WordPress and hosted on a PHP server. I've experimented with .htaccess without much success.

© Stack Overflow or respective owner

Related posts about php

Related posts about testing