How to Redirect / Forward Entire WordPress Blog

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Hackourlives just moved to a new Host (Inmotion Hosting: These guys have awesome service and servers are fast) and a new domain. So, once again we had to get the post redirection working to redirect users to our new abode. Earlier we had tried using a wordpress plugin to achieve this, but the plugin seems more appropriate for individual post redirection and I was not able to configure it to have desired results. Well here is a very simple and elegant solution which can be done in a couple of minutes.

Just add the following line to your .htaccess file in your web server root directory.

RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

My existing .htaccess file looked like this

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

I added the line after this line

RewriteEngine On

and saved the file which now looks like this (don’t forget to replace the newdomain address)

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule (.*) http://www.yournewdomain.com/$1 [R=301,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

That is all, now all your posts, categories and pages would get redirected (using 301 redirection) to your new domain. Only pre-requisite for this to work is to have Apache Mod-Rewrite enabled, which is usually a standard feature for most Web Hosts. This approach of 301 redirection is possibly the best approach to maintain traffic without loosing your search engine rank.

You might also like

InMotion Hosting VPS Review Recently we...
WordPress Blog Post by Post Redirection! You recently...
Must Have Free Windows 7 Software Open source/free...
How to Convert a WordPress Blog to Blogspot (Blogger) If you have...

About the Author

has written 346 posts on this blog.

Meditating towards his "nerdvana", lifehacker is a teacher by the day and a nerdy blogger by the night. He lives to learn and yearns to learn living.

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!

*

Copyright © 2017 Hack Your Life!. All rights reserved.
Proudly powered by WordPress. Developed by Deluxe Themes