K
K
kimqar1232021-04-19 10:34:45
PHP
kimqar123, 2021-04-19 10:34:45

Removing duplicate slashes in url does not work on Bitrix static pages?

The task is to remove slashes in the url if they are repeated.

if (strpos($_SERVER['REQUEST_URI'], '//') !== false) {
    global $APPLICATION;
    LocalRedirect($APPLICATION->GetCurDir(), false, '301 Moved permanently');
}

This code only works on dynamic pages, for example in a directory:
https://site.ru/product/karandashi-plastikovye-18-tsv-maped-color-peps-strong-trekhgrannye-povyshennoy-prochnosti-862718////////

will change to
https://site.ru/product/karandashi-plastikovye-18-tsv-maped-color-peps-strong-trekhgrannye-povyshennoy-prochnosti-862718/

But if the page is static, for example
http://site.ru/uslugi/
Then if you write a slash in it,
http://papiruscopy3.itech-test.ru/uslugi////////
then it will remain so.
What could be the problem? Tell
me I tried to set a redirect through htAccess, still the same, static pages do not change

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2021-04-19
@shambler81

painted everything here
https://klondike-studio.ru/standards/standartnyy-h...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question