Remove double trailing slashes

with .htaccess.

I noticed that some referers (most notably Facebook) would sometimes add an extra trailing slash to a URL. This little .htaccess regex removes that, so it keeps your analytics clean:

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

What's next?

If you think this was useful to you, it might be for others also. Feel free to share: