How to Remove WWW From Website URL

This article is all about how to remove WWW from domain name URL. In this guide, I have mentioned how could you do it easily.

0
How to Remove WWW From Website URL

You all know that WWW is an abbreviation stands for World Wide Web. It is a complete set of documents and other web resources that are identified by Uniform Resource Locator (URLs), interlinked by hypertext links that use HTTP protocol.

In this article, I will cover following points:

  • Why we use WWW in URL?
  • Benefits of not having WWW in domain name URL.
  • How to Remove WWW from site URL?
  • Does it impact SEO?
  • How to set the Preferred Domain in Google Webmaster tools?

READ ON: Here is the Performance Optimization in an HTTP/2

So, let’s start.

Why We Use WWW in Domain Name URL?

All websites run on HTTP. Earlier it was essential to have WWW in URL to tell the browser to connect to the HTTP server. But now each browser run this protocol by default. Thus now, it is not necessary to have WWW as a prefix in website URL.

Benefits of not having WWW in domain URL:

  • The website can very well be loaded without it.
  • Branding, domains look nice and short.
  • Save visitors time, users will not have to write WWW each time they visit your site.
  • As I wrote above, all browsers have HTTP by default. Thus, if you directly search by domain name.com, you will redirect you to the same site.

How To Remove WWW from Domain Name URL?

So, here is the main task starts.

  1. Remove WWW From URL (.htaccess):

To do so, you just need to add some lines of code in your .htaccess file.

Add the following mod_rewrite rule to your .htaccess file. While doing this, make sure you have enabled Apache’s mod_rewrite module.

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

Now, whether user typing WWW while entering the domain name or not, the browser will show domain-name.com in both the cases as the code automatically removes WWW from URL.

2. Remove WWW From URL (Nginx):

In the case of Nginx, the snippet is different. But, if setting it properly in the proper configuration file, it will work fine.

server {
server_name www.example.com;
return 301 http://example.com$request_uri;
}

Now, restart Nginx and check if it’s working properly.

Thus, you have successfully removed WWW from your site URL. But here many queries arises. Let me cover them.

Does keeping or removing WWW impact SEO rankings?

You might have a question for using it or not will have an impact on your SEO. Well, the answer is NO. It just the matter of preference/esthetics.

But, I recommend making this bigger change at the beginning of your startup. Keep in mind that you are changing the URL. So, changing it later may harm your SEO rankings.

READ: 2017’s Five Most important Factors To Improve Ranking

Now, the question arises How?

Here is the answer:

All your backlinks which are pointing to the URL and the page rank both will be lost.

Huh, this is my situation, What to do?

Hey, don’t worry. There is also a solution over it.

You just need to set the preferred domain in Google Webmaster Tools. Then Google will automatically display your choice of the domain in the search results.

But How To Set Preferred Domain In Google Webmaster Tools?

  • Open Google Webmaster Tool.
  • Log in to your account.
  • Verify, your domain if you have not done it before. Also, verify the other version by the same process.
  • Go to Site configuration > Settings > General Settings.
  • Set your preferred domain. Google gives two options.
  • Display URLs as www.domain-name.com
  • Display URLs as domain-name.com. Set Accordingly.
  • Save the changes.

READ: How To Add Your New Site To Google Webmaster Tools

Conclusion:

As I mentioned earlier, you just need to change configurations. Do not worry about security and SEO rankings. Google Webmaster Tools will take care of all the SEO stuff. Also, read how to Clean Your Bad Backlink to keep your site SEO clean.

If you have any question, feel free to ask in the comment section below.

LEAVE A REPLY

Please enter your comment!
Please enter your name here