Answer the question
In order to leave comments, you need to log in
How to remove slashes at the end of url in .htaccess?
There is a rule
#Убираем слэш в конце
RewriteCond %{HTTP_HOST} (.*)
RewriteCond %{REQUEST_URI} /$ [NC]
RewriteRule ^(.*)(/)$ $1 [L,R=301]
Answer the question
In order to leave comments, you need to log in
############################################################################
#### Убираем повторяющиеся слеши (/) в URL ####
############################################################################
RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
#Проверяем, повторяется ли слеш (//) более двух раз.
RewriteRule . %1/%2 [R=301,L]
#Исключаем все лишние слеши.
I’m not an expert in .htaccess regular expressions, of course, but in theory you need to replace (/) with (/+)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question