In the recent months, Fabie and I have been seeking for an unobtrusive mechanism to further optimise SilverStripe based installations for search engines.
That is, pages with a trailing slash and pages without a trailing slash are accessible to search engine crawlers. While this isn't necessarily an issue for humans, it essentially creates two independent pages with identical content; resulting in various negative implications for search engines.
The phenomena is known as [url=http://www.mattcutts.com/blog/seo-advice-url-canonicalization/]Canonical URLs[/url].
Fortunately, a developer from Fontis IT consulting and T3hDuk have been able to formulate a suitable work-around that takes advantage of Apache's mod_rewrite functionality. That is, it doesn't touch the Sapphire core at all!
I thought it would be appropriate to share with everyone, in case other developers feel that they are in a similar position to me.
* Adds a trailing slash to URLs without a trailing slash
* Capability to redirect requests without the WWW to include the WWW
* Correct the /home 302 redirect
* All redirects are 301