Created
July 10, 2015 00:23
-
-
Save rlandas/9773a96c109ed5bc3532 to your computer and use it in GitHub Desktop.
APACHE Remove multiple slashes anywhere in the URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # remove multiple slashes anywhere in url | |
| RewriteCond %{REQUEST_URI} ^(.*)//(.*)$ | |
| RewriteRule . %1/%2 [R=301,L] |
This soution fails if URL has odd number of slashes!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're Genious, man!
The whole day of strugling and the final success.
All my attempts led to double 301 redirect like https://site.com//// >301> http://site.com/ >301> https://site.com/
Now it's just one hop https://site.com//// >301> https://site.com/