Created
July 28, 2016 12:21
-
-
Save s2ar/382061fc71d98fb2df11751bdaa7be65 to your computer and use it in GitHub Desktop.
Убрать слеши в htaccess
This file contains 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
#Правило обрабатывает внутренние страницы | |
# http://site.ru/catalog////item/// | |
RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$ | |
#Проверяем, повторяется ли слеш (//) более двух раз. | |
RewriteRule . %1/%2 [R=301,L] | |
#Исключаем все лишние слеши. | |
#удаляем слеши для главной http://site.ru///// | |
RewriteCond %{THE_REQUEST} ([^\s]*)\/{2,}(\?[^\s]*)? | |
RewriteRule (.*) / [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment