How to solve canonicalization issue or what is htacess file?

A canonical issue arises when 301 redirects are not properly in place. This means that your website can be accessed by search engines from several different URLs. This means that search engines can then potentially index your site under different URLs, meaning that it will look like a site of duplicated content.
 
We use Canonicalization to avoid the duplicate content of the website by inserting the canonical url in the source code of the webpage which tell the search engine spider that which is the right page for caching. Whereas .htaccess is a file which is used to redirect the webpage or website to the new location permanently or temporally.
 
.htacess file is used to solve the canonicalization issue of a website. It may happen that the home page of the site may take several URLs like

1. www.abc[dot]com (with www)
2. www.abc[dot]com/index.html (Index page)
3. abc.com (without www)

The search engines might treat these URL as different and may divide the link juice gained by having various backlinks made with any of these 3 URLs. The link juice gets divided between these three URLs equally. .htacess file is created to have a single URL of the home page so that the link juice is passed onto single URL.
 
First of all, you need to know about your site have which types of server. Mostly these types of server use a htaccess file:
1- Linux, 2- Apache
If your hosting account uses one of these types of the server then you can copy below code into your htaccess file.

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^ example.com [NC]
RewriteRule ^(.*)$ http://www.example .com/$1 [L,R=301]
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . http://www.example.com%1/%2 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*)index\.html\ HTTP/
RewriteRule index\.html$ http://www.example.com/%1 [R=301,L]\

Note: In red highlights, you need to replace example.com with your domain name and in green highlights, you need to replace with your .html or .php index page. Keep in mind do not write just index, write extension too.

After the copy, this code with your htaccess old code, Save it and upload to your root folder where your site has index page. Hope it will solve.
 
Canonicalization issue arises when your website is accessed by search engines from different url. To solve this issue you can put the following tag pointing to your main page (open tag< link rel="canonical" href="#" close tag>) this will tell google that the main url is abc(dot)wordpress(dot)com and not any other one.
 
Why not backup the data on conputer , in this way , even if you have lost or deleted data on Android phone , you are able to get them back on Android phone ,
 
.htacess file is used to solve the canonicalization issue of a website. It may happen that the home page of the site may take several urls like

1. www.abc[dot]com (with www)
2. www.abc[dot]com/index.html (Index page)
3. abc.com (without www)

The search engines might treat these URL as different and may divide the link juice gained by having various backlinks made with any of these 3 URLs. The link juice gets divided between these three URLs equally. .htacess file is created to have a single URL of the home page so that the link juice is passed onto single URL.
 
Back
Top