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 )

Jaspreet Singh
Jaspreet Singh
Passionate, Dynamic Personality, Hard working and Ground to earth persona.Always come forward for the needy people As our religion always teach us Kirat Karo (Working Hard at whatsever task you undertake and making an honest living), Vand chhako (Sharing one's wealth, possessions, and talents with others) and lastly Naam Japo (Meditation on God inwardly and outwardly through reciting, chanting and singing.

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, https://seocorporation.net is a different site than https://www.seocorporation.net though both are the same site. This situation creates a problem in link building. Links pointing to http://seocorporation.net and https://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, https://seocorporation.net is a different site than https://www.seocorporation.net though both are the same site. This situation creates a problem in link building. Links pointing to http://seocorporation.net and https://www.seocorporation.net diminishes the link popularity which can create a 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 a backup. In case, anything goes wrong, you can upload the original copy
3. Save a copy of the .htaccess file elsewhere as a backup. In case, anything 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 ^(.*)$ https://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 whether it redirects 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)