Learn Digital Marketing Online

Http To https Redirect & www to non www URL For SEO

1 2,445

Many users have confused between HTTP to https redirect & www vs non-www URL, and this question has asked many times which URL pattern should prefer for better SEO ranking advantage. My article helps you to clear your confusion.

First, we need to know from where the confusion has started for HTTP and www vs non-www URL.

HTTP to https & www vs non-www URL better for SEO ranking

This confusion has started when you add your website URL into Google webmaster tools. It’s given the options to set your preferred domain (www or non-www URL). So most users got confused about what to select mostly newbie.

Definitely there are some cons and pros for www to non-www URL and their solution too. Otherwise, there is no extra benefit. It is only your preference which you select. There are two types of impact one is for SEO and second for technical.

HTTP to https redirect & www vs non-www URL

www vs non www URL

Which is better URL www to non-www for SEO ranking

If you are going to set up your new website, I will suggest you to use Http to https redirect www to non-www in your URL on your website, www URL having some benefit or logical advantage over non-www sites.

When you are going to start SEO of your site, you optimize load time and speed of your website and you want your site response fast to your users.

When we jump to link building and directory submissions, some of the directories will force you to add a proper URL including www.

Yes, this is the logical point when you have to use unnecessary www for getting a backlink to your website.

And when any user will click on generated backlink a request will go to your web server with the www and your server returns a non-www URL.

The solution for this you have to set a canonical link tag in your head/header file. This means you are adding a server-side HTTP to https redirect 301 on your website. That is why we suggest you use www to non-www URL on your site.

The second part of the difference between www to non-www URL is technically more flexible with DNS.  When you register any domain name it comes without www, and when you host it with www then www consider as your hostname and serve all the content to the public.

If you are using your site with www hostname that will help in file structuring of website. It also has the ability to restrict cookies when you use multiple sub-domains.

Redirect www to non-www

The non-www URL referred to as naked URLs, and the naked domain would not have CNAME benefit. As above I already suggest you if you are building your website from scratch then use www in that.

And if you already website and want to change it will directly impact your current website rank and you have to pay attention more to do change canonical URL. You also have to spend more time to get your rank back.

Here is the htaccess code to redirect www to non www URL & http to https redirect

RewriteCond %{HTTPS} off

RewriteCond %{HTTP_HOST} !^www.(.*)$ [NC]

RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

 

RewriteCond %{HTTPS} on

RewriteCond %{HTTP_HOST} !^www.(.*)$ [NC]

RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

HTTP to https redirect htaccess

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

OR

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ [R=301,L]

 

Conclusion:

www to non-www URLs is your preferred choice for Google, there are no benefits in terms of the Google ranking. But there are several technical benefits on www over non-www URLs websites. If you know about any other difference and benefits let us know by comments.

If you find this article use full for you, please subscribe and share it with others to help them.

Become An Expert in Digital Marketing
Enter your email below to get WordPress, SEO and traffic tips
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

1 Comment
  1. jitun nahak says

    Thanks for sharing this submission sites, it’s very helpful for me to improve the website ranking, once again thank you. keep it up..