Answer the question
In order to leave comments, you need to log in
Eliminate non-existent pages that have more than one slash in the URL at an arbitrary level of nesting of sections.?
Good afternoon.
i.e., for example, a redirect from catalogue/////kukhni/ to catalogue/kukhni/
/catalogue/////accessories/ => /catalogue/accessories/
/catalogue/accessories///// => / catalogue/accessories/
////catalogue/accessories/ => /catalogue/accessories/
this works when
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{THE_REQUEST} ^[AZ]+\s//+(.*)\sHTTP/[0-9.]+$
RewriteRule .* https://% {HTTP_HOST}/%1 [R=301,L]
Answer the question
In order to leave comments, you need to log in
############################################################################
#### Убираем повторяющиеся слеши (/) в URL ####
############################################################################
RewriteCond %{THE_REQUEST} //
# Проверяем, повторяется ли слеш (//) более двух раз.
RewriteRule .* /$0 [R=301,L]
# Исключаем все лишние слеши.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question