Pulling my hair out over this one.

I have one wordpress install at /2009 and one at /2010. I am trying to redirect all requests to the 2009 site to the 2010 site. I have tried both of these in the root .htaccess and in the /2009 .htaccess:

RewriteRule ^2009.*$ 2010 [R=301,L]

RewriteCond %{REQUEST_URI} ^2009.*$
RewriteRule . 2010 [R=301,L]

But the 2009 site keeps loading. Any ideas?

Accepted Answer

Just to clarify: You have a wordpress install on the server at /Document/root/2009, viewable in a browser at http://server/2009, and a wordpress install at /Document/root/2010, viewable in a browser at http://server/2010, correct?

The easiest thing to do is login to the server, cd /Document/root and do this:

mv 2009 2009.backup
ln -s 2010 2009

If you do not have shell access to the server in question, then the second easiest method is to rename the index.php for wordpress in 2009 and load this index.php to it:

header("Location: http://server/2010/"); /* Redirect browser */
Written by Richard June
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki