License is attached inside extras folder by using this software you agree to the terms of that license.

Plugin Name: Canonical
Plugin Author: Jesse Labrocca
Plugin Website:  http://www.MybbCentral.com
Plugin Version: 1.0
Plugin Mybb Compatibility: 1.4x
Plugin File Edits: None
Plugin File Uploads: 1
Plugin Description:  This plugin will allow your site to adhere to the new rel=canonical standard for better SEO by adding the tag to headerinclude.  Currently working only for forumsdisplay.php and showthread.php. (read below for more details)

Installation

1. Upload the file from the zip to your plugins directory.

2. Login to your admincp and ACTIVATE the plugin (Canonical) in the plugin manager.

3. Check your admincp setting under "Server and Optimization Options" and for the "Enable search engine friendly URLs?" either choose "Enabled" or "Disabled". It's best not to use "Automatic Detection".

Troubleshooting: If you don't see in the source code of your forumdisplay or showthread pages the rel=canonical tag in header then in admincp edit the "headerinclude" template and on the first line add {$canonical}.  Double check source code (f5 refresh).  This is also NOT compatible with any SEO plugin but is compatible with default mybb SEF URLs.

Testing:  For easier testing I have an echo $link in the canonical.php file on the bottom. You can uncomment it and you should see the displayed canonical URL on top of the page. Make sure to comment it again once you are done testing.

More about CANONICAL
============================
Recently Google, MSN, and Yahoo! search engines created a new method for indexing urls. You can read some of that info here:
http://www.mattcutts.com/blog/seo-advice-url-canonicalization/
http://blogs.msdn.com/webmaster/archive/2009/02/12/partnering-to-help-solve-duplicate-content-issues.aspx
http://ysearchblog.com/2009/02/12/fighting-duplication-adding-more-arrows-to-your-quiver/

Currently Mybb creates many duplicate URLs.  Even under their SEF the issue exists:
Examples at Mybboard.net: 
http://community.mybboard.net/forumdisplay.php?fid=81&datecut=0&sortby=rating&order=desc
http://community.mybboard.net/thread-34110-post-228845.html#pid228845
http://community.mybboard.net/showthread.php?mode=linear&tid=34110&pid=228845#pid228845

This plugin would instead rel=canonical into cleaner URLs:
http://community.mybboard.net/forumdisplay.php?fid=81
http://community.mybboard.net/thread-34110-page-2.html
http://community.mybboard.net/thread-34110-page-2.html

As you can see from the above example link 2 and 3 are the exact same content but Mybb would have multiple URLs all displaying that content.  

I have in the extras folder a screenshot showing a handful of URLs inside my Google Webmaster Tools section.  Take a peek. You can see the duplicate URLs that Google views:
/showthread.php?tid=1047&page=10
/showthread.php?tid=1047&pid=211134
/showthread.php?tid=1047&pid=401316
/showthread.php?tid=1047
/showthread.php?tid=54074&action=nextoldest

With this plugin search engines will be given the url correctly as showthread.php?tid=1047 as the main URL to index. 

This will also work with pages as this:
http://www.hackforums.net/showthread.php?tid=1047&pid=401316
will get indexed correctly as this:
http://www.hackforums.net/showthread.php?tid=1047&page=11

I suggest you do read up on the above blog posts from the search engines to learn more about what this plugin is meant to do. 

DEMO: http://www.hackforums.net

I can be reached at either http://www.mybbcentral.com as username LABROCCA

Thank you.
Jesse Labrocca

