Website with and without www
However, search engines don’t think so. For them, the site specified with WWW and specified without WWW are two different sites. Is this best for SEO? In short, (directly) NO. From an SEO viewpoint, it doesn’t make a difference whether you use WWW or none, in your domain name.
Actually, because of this, a big problem arises. Since some of the external sites will link to “backlinkexpress.com”, and the other part to “www.backlinkexpress.com”, as a result, the total link weight will be shared between the two domains. And this is very bad in terms of search engine optimization.
And plus to all this, take. the same content is located on two different domains, then search engines will perceive it as duplication, and because of this, they will lower the main site in the search results.
Thus, I think you now understand what all this can lead to web development.
But do not rush to get upset, because there is a solution and it is very simple. First, you need to decide which version of the domain name you want to use (with or without WWW).
If you want your site to be with the WWW, create a .htaccess file and write the following in it:
1 2 3 | RewriteEngine On RewriteCond %{HTTP_HOST} ^backlinkexpress.com$ [NC] RewriteRule ^(.*)$ https://www.backlinkexpress.com /$1 [R=301,L] |
Naturally, the name of my domain ozairwebs.com, in the above code, replace with your domain.
If you want your site to be without WWW, then specify a slightly different code in the .htaccess file:
1 2 3 | RewriteEngine On RewriteCond %{HTTP_HOST} ^www.backlinkexpress.com $ [NC] RewriteRule ^(.*)$ http:// backlinkexpress.com/$1 [R=301,L] |
Here it is similar, the name of my domain is backlinkexpress.com, and you need to replace it with your domain.
The resulting .htaccess file, upload to the root of your site. If you don’t know how to create .htaccess, then you can download ready-made from additional materials.
Note: if there is already an .htaccess file in the root of your site, then you do not need to create a new one. Just open the existing one for editing and add the code above to the very end.
What have we done by adding these lines of code?
Let’s say we decided to make our site without WWW and added the appropriate code to .htaccess. Now, if a user types our site in a browser like “backlinkexpress.com”, then nothing will actually happen. But then, if he types our site as “www.backlinkexpress.com”, then 301 redirects (redirection) to the domain “backlinkexpress.com” will occur.
This redirect will let the search engines understand that these two domains are one, because we sort of “glued them together”. And this way we get rid of the loss of link mass and duplicate content.