The one and only method to remove multiple/double slashes from URLs (apache, mod_rewrite)
That’s the solution that worked for me …
# remove multiple slashes
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$ [NC]
RewriteRule . %1/%2 [R=301,L]
# … within URL-path
RewriteRule ^(([^/]+/)*)/+(.*)$ http://%{HTTP_HOST}/$1$3 [R=301,L]
# … before URL-path
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} //+([^ ]*)
RewriteRule .* http://%{HTTP_HOST}/%1 [R=301,L]
Tags: apache, mod_rewrite, slashes, url