Tag Archives: apache

Canonical URLs are easy to implement and are important in SEO to avoid duplicate content penalties. Take www.example.com for instance. Without canonicalisation – Google will treat this website AND the website on the main domain at example.com as separate independent websites. Thus, diluting traffic.

An easy way to fix this, is to create a .htaccess file in your website root (normally /httpdocs or /public_html). In this file, paste the following code at the top of the document:

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

This code will ensure that any user…


footer.php