How to solve canonicalization issue or what is htacess file?

Started by Roy Milson, 01-10-2017, 06:04:10

Previous topic - Next topic

Roy MilsonTopic starter

How to solve canonicalization issue or what is htacess file?


SerenMckay

.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.


JohnVilson

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 by SEO companies.

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^ example[dot]com [NC]
RewriteRule ^(.*)$ www[dot]example[dot]com/$1 [L,R=301]
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . www[dot]example[dot]com%1%2[R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*)index\.html\ HTTP/
RewriteRule index\.html$ www[dot]example[dot]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 the index page. Hope it will solve.

RH-Calvin

.htaccess is a configuration file for use on web servers running the Apache Web Server software. ... These .htaccess files can be used to alter the configuration of the Apache Web Server software to enable/disable additional functionality and features that the Apache Web Server software has to offer.

Usman Shani

The best and most effective way to resolve the canonical issue is with a permanent 301 redirect. This can be implemented in a number of ways, as detailed below. Depending on what server your website is hosted on will determine the method which you use to implement a redirect.


manivel

You can solve the canonicalization issue with two ways:

1. 301 Redirects
2. Link Tag using Rel Canonical

JSImediaJS123

There are two methods for solving canonical issues:
1. Either do writing 301 redirection code in the htacess file.
Actually htacess file is the file for solving canonical problem not only canonical problem we can write here the url structure in which we want to show our url in the browser.

2. You can write cannonical code <link rel="canonical" href="your url">

3. In webmaster fix your domain from the preferred domain option from the setting menu.

vickyciky

In order to avoid duplicate content issues, we need to add the link tag inside the head section of the duplicate content URLs. It will be like:

<link rel="canonical" href="http://www.xyz.com/product.php?item=red-widget">

In the above line, rel="canonical" is a hint that Google follows strongly and will be taken into account with other signals when calculating the most relevant page to be displayed in the results page. But one must keep this in mind that Google will take canonical suggestions into account within a domain or across sub-domains but not across domains. Some other advantages of this solution are as follows:

• Relative paths can be used to specify the canonical.
• If rel="canonical" returns a 404 error then too search engines will continue to index the content and will use heuristic to find a canonical.
• If the canonical has not yet been indexed, Google will index it as per according to the working of its algorithm and will then consider the canonical tag.


amayajace

The best and most effective way to resolve the canonical issue is with a permanent 301 redirect. This can be implemented in a number of ways, as detailed below. Depending on what server your website is hosted on will determine the method which you use to implement a redirect.


anilkh7058

A file which have one or more configuration directives.
:)
  •