Answer the question
In order to leave comments, you need to log in
How to redirect in one step?
There is a site to which double /
https://tehikhouse.by/catalog//reaktor_rb//
to solve the problem, I wrote the following lines in HTACCESS
RewriteCond %{REQUEST_URI} ^(.*?)\/{2,}(.*? )$
RewriteRule . %1/%2 [L,R=301]
RewriteCond %{THE_REQUEST} //
RewriteRule .* /$0 [R=301,L]
They are gone, but the solution is not quite correct because multiple redirects are performed, i.e. the redirect is performed several times , from one page to another, to one or more.
How to do it in one step?
Answer the question
In order to leave comments, you need to log in
RewriteCond %{REQUEST_URI} ^(.*?)\/{2,}(.*?)$
RewriteRule . %1/%2 [L,R=301]
RewriteCond %{THE_REQUEST} //
RewriteRule .* /$0 [R=301,L]
RewriteCond %{THE_REQUEST} //
RewriteRule .* /$0 [R=301,L]
//
necessary to limit the search so that the redirect does not loop.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