Fix for trailing slashes
Created: Last updated:
For general information about the trailing slash problem with SEO please click the link. This article is a quick summary and log about changes in my framework and not the problem behind it.
A trailing slash in an URL was not really a problem for the application but it lead to duplicate content in search engines. The framework ignores the slash and simply returns the same page.
Google, for some unknown reason, suddenly requested pages with a trailing slash and because it received a valid 200 OK response, of course, indexed both versions. In the Webmaster Tools I noticed the duplicate title tag and description.
I added a fix that returns a 301 redirect response instead of the webpage.
Update #1: The duplicate versions in Google's Webmaster Tools disappeared after about a couple weeks.
Update #2: Some pages show up with the same problem and it turns out for module pages. If have moved the fix ahead in the process.