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

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)

Recent Posts

SEO Backlink Services- Why do backlinks matter in SEO?

In this digital market, it has become routine for businesses to upgrade their websites, features,…

1 year ago

Meta title and description: an integral part of SEO

Meta title and description: an integral part of SEO What are meta descriptions and how…

1 year ago

Content gap analysis: methods and strategies

Table of content An ordered HTML list How To Identify & Fill The Content Gap…

2 years ago

How Digital Marketing Can Help Local Businesses To Expand Rapidly

Today, everything is digitalized from shopping to buying homes, from finance to classes, Internet Marketing…

2 years ago

Operate your small business globally with the power of digital marketing

In this present world, it is pretty crucial for every small business to try out…

2 years ago

How to Get More Online Clients for Your Cleaning Business

Marketing has seen a significant shift in the past half-decade and especially after Covid 19…

2 years ago

This website uses cookies.