Answer the question
In order to leave comments, you need to log in
Does the htacess rule work correctly for one link but not for another?
There is such a htacess rule that removes multiple slashes correctly without extra
http which looks something like
this, the rule itself is
RewriteCond %{THE_REQUEST} ^[^?]+//
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]
#order deny,allow
#deny from all
RewriteEngine On
# Директива включает редиректы !!!!
RewriteBase /
# Без директивы "(.*) = /$1" будет /var/wwww/site/web/$1 с директивой = /$1
Options +FollowSymLinks
# Разрешает переход по символическим ссылкам.
php_value error_reporting 1
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ / [R=301,L]
#RewriteCond %{REQUEST_URI} !^/$
#RewriteCond %{REQUEST_URI} (.*)/$
#RewriteRule . %1 [R=301,L,E=NS:1,QSA]
RewriteCond %{REQUEST_URI} ^\/$
RewriteCond %{HTTP_HOST} ^www\.(.*)$
RewriteRule ^(.*)$ https://%1/$1 [L,R=301]
RewriteCond %{THE_REQUEST} ^[^?]+//
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{REQUEST_URI} \..+$
# Если файл содержит точку.
RewriteCond %{REQUEST_FILENAME} !-d
# И это не директория.
RewriteCond %{REQUEST_FILENAME} -f
# Является файлом.
RewriteCond %{REQUEST_URI} ^(.+)/$
# И в конце URL есть слеш.
RewriteRule ^(.+)/$ /$1 [R=301,L]
# Исключить слеш.
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
Redirect 301 /site/index /
RewriteCond %{REQUEST_URI} !^/generate-webp.php$
RewriteCond %{REQUEST_URI} !^/sitemap.php$
RewriteCond %{REQUEST_URI} !^/php.php$
RewriteCond %{REQUEST_URI} !^/allJS\.php?v2$
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NC]
Answer the question
In order to leave comments, you need to log in
For "/4987/pc/3800000////////" the rule is triggered:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
/$1
lacks an explicit indication of https: //RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ https://%{HTTP_HOST}/$1 [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question