301 Redirect using htaccess Linux server (www, non-www )

shape
shape
shape
shape
shape
shape
shape
shape

301 Redirect using htaccess Linux server (www, non-www )

Joshua Hardwick
Vishal Vivek
I am the guy responsible for establishing and growth of SEO Corporation, a New Delhi based leading SEO & Web agency. I am a serial entrepreneur. You can find me deeply engrossed in books when I am not working.

Short tutorial on “How to 301 Redirect Non-WWW to WWW URLs” Search Engines see a site with www and without www as two different sites. For example: http://seocorporation.net is a different site than http://www.seocorporation.net though both are the same site. This situation creates a problem in link building. Links pointing to http://seocorporation.net and http://www.seocorporation.net diminishes

Short tutorial on “How to 301 Redirect Non-WWW to WWW URLs”

Search Engines see a site with www and without www as two different sites. For example: http://seocorporation.net is a different site than http://www.seocorporation.net though both are the same site. This situation creates a problem in link building. Links pointing to http://seocorporation.net and http://www.seocorporation.net diminishes the link popularity which can creates serious problem in terms of SEO.

How to 301 Redirect Non-WWW to WWW URLs?

This problem can be overcome very easily by 301 redirecting the non-www version to www version. 301 is a permanent redirect and it helps a site achieve top rankings as all the link pointing to the different version point to one single URL.

We are going to discuss 301 Redirect using .htaccess on Linux server.

How to apply 301 redirect using htaccess Linux server (www, non-www, index page) i.e we are going to discuss the installation of Non-WWW 301 Redirect on an Apache Server:

1. Download the .htaccess file from your website’s root to your computer.
2. Save a copy of the .htaccess file elsewhere as backup. In case, any thing goes wrong, you can upload the original copy
3. Save a copy of the .htaccess file elsewhere as backup. In case, any thing goes wrong, you can upload the original copy
4. Open the htaccess in notepad.
5. Add the following code (in bold) into the .htaccess file. Replace the “example.com” with your own website URL but touch nothing else.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^seocorporation\.net$ [NC]
RewriteRule ^(.*)$ http://www.seocorporation.net/$1 [R=301,L]

6. Upload the file in the same place from where you downloaded it.

Once you have uploaded the file, try to open Non-www version of the website in a browser and see wheteher it re-directs to www version or not. If it works, congratulations!!

In case, you want help with setting up 301 redirect. You can call SEO Company India experts at 1-855-801-9192 (Toll free)