Remove double trailing slashes

With just two lines of code in .htaccess

A neat little code snippet that keeps your analytics (just a little bit) cleaner #

I noticed that some referers would sometimes add an extra trailing slash to a URL.

This little .htaccess regex removes that, so it keeps your analytics clean. It basically says: "check the URL that is requested. If a double slash is found, replace it with a single slash." Easy peasy.

RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
→ Call to action ←

Sounds interesting?

Then let's make the virtual gap between us a little bit shorter!