Monday, April 26, 2010

Handling The Trailing Slash in Your urls

It has long been a topic of concern as to what effect having a trailing slash on urls (i.e. http://www.tengoldenrules.com vs. http://www.tengoldenrules.com/) has on search engine optimization. Although it is possible to have different content on both the url with a trailing slash and the same url without a trailing slash, this can be very confusing to users. Therefore, from a user perspective, it is not recommended to have pages with different content in which the only difference in url of those pages is including a trailing slash.

Now lets look at this from a search engine perspective. Having the same content on a trailing slash and a non-trailing slash version of a url can become a duplicate content issue. Search engines can see this as two separate pages, flagging one of the pages as duplicate content. This can, however be remedied fairly simply.

According to Google's Webmaster Central Blog, the best remedy to having duplicate content on trailing slash and non-trailing slash urls is to first choose a preferred version. Let's say we prefer the trailing slash version. Next, you will want to make sure that all links within your website and sitemap point to the preferred version of the urls (in this example it will be the version with the trailing slash). Finally, perform a 301 redirect from the non-trailing slash urls to those urls with a trailing slash.