Trailing slashes in URLs — SEO implications

Over the few months that the Hreflang testing tool has been live, I have noticed an erroneous pattern repeat itself in the URLs that SEOs submit for testing: many people use URLs with and without trailing slashes interchangeably. This is wrong.

http://www.example.com/de and http://www.example.com/de/ are technically 2 separate URLs. Google treats them as 2 separate pages. So does the test tool. The only situation where a URL with or without a trailing slash is the same is when specifying the root. For example, http://www.example.com and http://www.example.com/ are the same. Similarly, http://example.com and http://example.com/ are the same. And http://fr.example.com and http://fr.example.com/ are the same. In other words, it does not matter what the hostname is or whether it’s the root domain or a subdomain.

But if the path after the hostname is not empty, then URLs with and without a trailing slash are considered different. Many websites have their content management system or web server configured to redirect the non-trailing-slash version to a page with a trailing slash. e.g. http://www.example.com/de is automatically redirects to http://www.example.com/de/. When this happens, SEOs sometimes don’t notice it and it reinforces their erroneous belief that both these URLs are the same and that trailing slashes don’t matter.

So what should SEOs do? Test if URLs with and without trailing slashes work. If both versions work (without one auto-redirecting to another), you might have a problem with duplicate content. Google tries to give sites a pass for such inadvertent content duplication but it’s always a bad idea to make things harder for Google or to increase Googlebot’s cognitive load. Besides, you are risking link dilution because inbound links will be split across both versions of the page.

If only one version works, or if one redirects to the other, make sure you use that correct version everywhere — in internal links, canonical tags, hreflang tags, social shares, ads. And when submitting it to the tool to test.

Further reading:
Google’s Guide on Trailing Slashes (old but still relevant)

Published by

Nick Jasuja

Nick Jasuja is the founder of Hreflang.org and Diffen, the world's largest collection of unbiased comparisons. Diffen's expansion to Spanish was Nick's first foray into international SEO and motivated him to launch the Hreflang testing tool. You can find him on Twitter @thisislobo.