I'd like to move a WP installation from a subdomain to its own without losing the PageRank achieved by that subdomain.
What are the best steps in order to do this properly? Especially how do I set the redirects properly?
Webmasters Stack Exchange is a question and answer site for pro webmasters. It only takes a minute to sign up.Sign up to join this community
Follow these instructions on moving WordPress, but use the root domain for references to your old subdomain instead of the /blog/ directory (I've made this change for you in the steps below):
Create a robots.txt file in the root directory of the new domain with the following contents:
User-agent: * Disallow: /
Copy the database and files to the new domain.
Edit wp-config.php to have the new database settings, and add the following lines, replacing example.com with the new domain:
define('WP_SITEURL', 'http://www.example.com'); define('WP_HOME', 'http://www.example.com');
Now set up your blog install with the same settings as on the old domain. (If you have a caching plugin installed, delete your cache files.)
On your old blog, add the following line to the top of your Apache .htaccess or vhost-config:
Redirect 301 / http://www.newdomain.com/
To keep your PageRank, the crucial step is step 7, which redirects requests for your old blog pages to the new site.