You are viewing an old revision of this post, from September 10, 2013 @ 23:47:53. See below for differences between this version and the current revision.

Redirect Old Domain to New Domain via .htaccess

Taken from: http://www.orderofbusiness.net/blog/redirect-old-domain-to-new-domain-via-htaccess/ When you migrate a site from one domain to another, it is very important that you don’t break all the links that you built to your old domain. Proper redirection of all the pages on the old domain to the same location on the new domain will ensure that visitors to the old domain will end up in the right place. A failure to redirect will result in a loss of visitors as well as search engine rankings. We are assuming that your web server uses Apache for the purpose of this tutorial. If you have not made any changes to your overall site structure, but have simply relocated the site in its current state, you can add the following lines to your .htaccess file located at the root of your old domain: [php] <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR] RewriteCond %{HTTP_HOST} ^www.olddomain.com$ RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L] </IfModule> [/php] If you have made changes to your site structure, you can still use the lines above on your old domain, but you will also need to create redirects in the .htaccess file on your new domain to handle the specific site changes. To redirect a single page to a new location on the same domain, use the following syntax: [php]Redirect 301 /old/old.htm http://www.domain.com/new.htm[/php] It is possible to create rules that will redirect URLs that follow a certain pattern to a new location. Since these rules involve complex regular expressions, we do not cover them here. An SEO professional can help you create these more complex and situation-specific rules. Just be sure that you use a 301 redirect for relocated content. Any other type of redirect will not preserve your search engine rankings.

Revisions

  • September 10, 2013 @ 23:47:53 [Current Revision] by PeterLugg
  • September 10, 2013 @ 23:47:53 by PeterLugg

Revision Differences

There are no differences between the September 10, 2013 @ 23:47:53 revision and the current revision. (Maybe only post meta information was changed.)

Tags: ,

No comments yet.

Leave a Reply