Issue In Removing Double Or More Slashes From URL By .htaccess

Give it a try with:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/{2,} [NC]
RewriteRule ^(.*) $1 [R=301,L]

It should redirect to a single slash at the end of the domain.
And an improvement on yours:

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

Leave a Comment