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
Entrepreneur, Virgo, speaker, writer, a pampered son & a loving brother. Featured as Inspiring Indian by The Times Group. Life is still unfolding for me. Lots to be written in the coming years. You can read some old news about me here: https://goo.gl/NGhwRi and my short story here( reprint of the story which was published in the Times Group book): https://goo.gl/cNtHgi Last but not the least, I am grateful to my mom & dad, my sisters, my friends, my fans for filling my life with love & happiness. Amen!

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)