Google Canonical URL Issue Optimization
GoogleBot treats sample.com and www.sample.com as two different web addresses, which also means that if you don’t take care of the cannonical issue, then every page than can be accessed as both www. and non-www. could get a split PR. Google also treats this as duplicate pages and punishes you for this. To resolve canonical issue problem, follow following steps :
1. Create a .htaccess file in the web root dir.
2. Copy and paste the following contents in it
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.sample\.com$
RewriteRule ^(.*)$ http://www.sample.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*)index\.html\ HTTP/
RewriteRule index\.html$ http://www.sample.com/%1 [R=301,L]
3. Save the file and upload it to the root path of your web site.
