PDA

View Full Version : How to implement canonical URLs?


pokusek
11-14-2010, 06:09 AM
Hello. I want to implement canonical URL to avoid duplicity, because vBulletin has identical content that's accessible through multiple URLs, e.g.:

http://forums.com/threads/283
http://forums.com/threads/283-Thread
http://forums.com/threads/283-anything

What should I enter between these quotes to get a specific URL, that will remain still the same under all circumstances (but every page on my forum must have a unique URL)?

<link rel="canonical" href="" />

Thank you for your help.

pokusek
06-19-2011, 10:33 AM
bump

LifesGreatestGift
06-19-2011, 03:41 PM
For starters, adding the following to your .htaccess will convert all non-www to www.
That solves half your problems ;)

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

--------------- Added 1308502216 at 1308502216 ---------------

Also in AdminCP>Settings>Options>Friendly URLs>

Choose the style you'd like to use, then set Enforce Canonical URL to strict, and Enforce Canonical URL for Registered Users to yes.

pokusek
06-19-2011, 04:15 PM
vBulletin does not support absolute canonical URLs - that's the reason why I want to insert it into the template manually.