Answer the question
In order to leave comments, you need to log in
How to remove duplicate words in URL using .htaccess?
Duplicate pages came out, tell me the regular expression for duplicate words in the URL,
links like
https://site.ru/shop/shop/
https://site/shop/shop/catalog/
https://site/shop/shop/catalog/ element/
should be redirected to
https://site.ru/shop/
https://site/shop/catalog/
https://site/shop/catalog/element/
tried it doesn't work
RewriteCond %{THE_REQUEST} ^/shop/shop/(.*)$ [NC]
RewriteRule ^(.*)$ /shop/%1 [R=301,L]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question