How to resolve canonical issue in html

  • Manually in your .htaccess file if you are comfortable doing that.

Options +FollowSymlinks

RewriteEngine on

RewriteCond %{THE_REQUEST} ^.*/index.html

RewriteRule ^(.*)index.html$ http://www.exmple.com/$1 [R=301,L]

rewritecond %{http_host} ^www.exmple.com [nc]

rewriterule ^(.*)$ http://www.exmple.com/$1 [r=301,nc]

ErrorDocument 404 http://www.exmple.com/

 

How to redirect www URLs to non-www:

html

RewriteEngine on

RewriteCond %{HTTP_HOST} !^$

 RewriteCond %{HTTP_HOST} ^www\.indramatdriverepair\.com [NC]

 RewriteRule ^(.*)$ http://indramatdriverepair.com/$1 [L,R=301]

 

How to redirect non-www URLs to www:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^example.com$

RewriteRule (.*) http://www.example.com/$1 [R=301,L]

 

Please follow and like us:
0

Add a Comment

Your email address will not be published. Required fields are marked *