|

Permanent Redirect To New Website

Just moved your website? How do you inform your site visitors and search engines(keeps page ranks, hopefully) about your site’s new location? Read on… :)

For your information, LcF Weblog previous home is http://weblog.LcFwebsite.com/. I have blogging quite a long time at the previous address before move to current domain name – LiewCF.com. After I moved my blog to current domain, I used HTML code to redirect visitors from LcFwebsite.com to LiewCF.com…

However, it is not the best solution. If visitor follows search engine link of my previous blog entries, they will still get a “page not found” error.

301 permanent redirect and URL rewrite is the answer.

I modified the .htaccess file in the root directory of LcFwebsite.com to the following:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^lcfwebsite.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.lcfwebsite.com$ [OR]
RewriteCond %{HTTP_HOST} ^weblog.lcfwebsite.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.weblog.lcfwebsite.com$
RewriteRule ^(.*)$ https://old.liewcf.com/ [L,R=301]

Note: This will do a permanent redirection on both domain(lcfwebsite.com) and subdomain(weblog.lcfwebsite.com) to https://old.liewcf.com

Now, user will redirect(seamlessly) to my new website, on every old links they follow. Search engine will also follow the old site links to my new site. Never lost your site visitor again! :grin:

References:

  • .htaccess Subdomains | msfn.org
  • Renaming/moving a page? 301 redirect it! | webhostinghunter.com
  • Permanent 301 Redirect, Can someone post an example or a link? | highrankings.com
  • URL Rewriting Guide | apache.org
Share this:

Similar Posts