N
N
Nikolai Egorov2020-03-24 19:33:45
symfony
Nikolai Egorov, 2020-03-24 19:33:45

How to disable encoding of special characters in the URL when forcing a redirect to HTTPS?

I installed a system of end-to-end analytics, call tracking and calltouch advertising management on the site, but it does not work, because after the http -> https redirect, some of the special characters in the URL are recoded.

View URL

http://site.ru/?utm_content=cid|{campaign_id}&calltouch_tm=yd_c:{campaign_id}_gb


Becomes
https://site.ru/?calltouch_tm=yd_c%3A%7Bcampaign_id%7D_gb&utm_content=cid%7C%7Bcampaign_id%7D


After contacting the hosting, I found out that it is the engine that does the coding, not the server. This was also indicated by the fact that the final URL had the same parameters, but in a different order.

Currently SYMFONY 4.2 is used.

The http -> https redirect is configured in access_control:
- { path: ^/, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }


I don’t know if it’s necessary to show it to you or not, but the hosting support sent me the output of the strace handler php - just in case, I’ll try to add it here under the spoiler.

I have no idea how to solve this problem ... for me it's a dead end, I ask for help.

php strace output

19:26:57.563786 fstat(7, {st_mode=S_IFREG|0644, st_size=987, …}) = 0
19:26:57.563823 mmap(NULL, 987, PROT_READ, MAP_SHARED, 7, 0) = 0x7fb71da27000
19:26:57.563870 stat("/var/www/u0092470/my-site.ru/vendor/white-october/pagerfanta-bundle/EventListener/ConvertNotValidMaxPerPageToNotFoundListener.php",
{st_mode=S_IFREG|0644, st_size=987, …}) = 0
19:26:57.563919 munmap(0x7fb71da27000, 987) = 0
19:26:57.563959 close(7) = 0
19:26:57.564017 access("/var/www/u0092470/my-site.ru/vendor/composer/…/white-october/pagerfanta-bundle/EventListener/ConvertNotValidCurrentPageToNotFoundListener.php",
F_OK) = 0
19:26:57.564070 open("/var/www/u0092470/my-site.ru/vendor/white-october/pagerfanta-bundle/EventListener/ConvertNotValidCurrentPageToNotFoundListener.php", O_RDONLY) = 7
19:26:57.564117 fstat(7, {st_mode=S_IFREG|0644, st_size=990, …}) = 0
19:26:57.564158 fstat(7, {st_mode=S_IFREG|0644, st_size=990, …}) = 0
19:26:57.564198 fstat(7, {st_mode=S_IFREG|0644, st_size=990, …}) = 0
19:26:57.564235 mmap(NULL, 990, PROT_READ, MAP_SHARED, 7, 0) = 0x7fb71da27000
19:26:57.564282 stat("/var/www/u0092470/my-site.ru/vendor/white-october/pagerfanta-bundle/EventListener/ConvertNotValidCurrentPageToNotFoundListener.php",
{st_mode=S_IFREG|0644, st_size=990, …}) = 0
19:26:57.564329 munmap(0x7fb71da27000, 990) = 0
19:26:57.564369 close(7) = 0
19:26:57.564476 access("/var/www/u0092470/my-site.ru/vendor/composer/…/symfony/http-kernel/Event/TerminateEvent.php", F_OK) = 0
19:26:57.564531 open("/var/www/u0092470/my-site.ru/vendor/symfony/http-kernel/Event/TerminateEvent.php", O_RDONLY) = 7
19:26:57.564577 fstat(7, {st_mode=S_IFREG|0644, st_size=604, …}) = 0
19:26:57.564617 fstat(7, {st_mode=S_IFREG|0644, st_size=604, …}) = 0
19:26:57.564657 fstat(7, {st_mode=S_IFREG|0644, st_size=604, …}) = 0
19:26:57.564697 mmap(NULL, 604, PROT_READ, MAP_SHARED, 7, 0) = 0x7fb71da27000
19:26:57.564744 stat("/var/www/u0092470/my-site.ru/vendor/symfony/http-kernel/Event/TerminateEvent.php", {st_mode=S_IFREG|0644, st_size=604, …}) = 0
19:26:57.564791 munmap(0x7fb71da27000, 604) = 0
19:26:57.564832 close(7) = 0
19:26:57.564880 access("/var/www/u0092470/my-site.ru/vendor/composer/…/symfony/http-kernel/Event/PostResponseEvent.php", F_OK) = 0
19:26:57.564934 open("/var/www/u0092470/my-site.ru/vendor/symfony/http-kernel/Event/PostResponseEvent.php", O_RDONLY) = 7
19:26:57.564980 fstat(7, {st_mode=S_IFREG|0644, st_size=995, …}) = 0
19:26:57.565020 fstat(7, {st_mode=S_IFREG|0644, st_size=995, …}) = 0
19:26:57.565064 fstat(7, {st_mode=S_IFREG|0644, st_size=995, …}) = 0
19:26:57.565102 mmap(NULL, 995, PROT_READ, MAP_SHARED, 7, 0) = 0x7fb71da27000
19:26:57.565148 stat("/var/www/u0092470/my-site.ru/vendor/symfony/http-kernel/Event/PostResponseEvent.php", {st_mode=S_IFREG|0644, st_size=995, …}) = 0
19:26:57.565195 munmap(0x7fb71da27000, 995) = 0
19:26:57.565235 close(7) = 0
19:26:57.565304 chdir("/var/www/u0092470/php-bin/urist-expert24.ru") = 0
19:26:57.565380 setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0
19:26:57.565452 close(5) = 0
19:26:57.565513 fcntl(3, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
19:26:57.565563 write(4, «\1\6\0\1\3\232\6\0Status: 301 Moved Permanently\r\nX-Powered-By: PHP/7.2.23\r\nSet-Cookie: PHPSESSID=39e03d85132f54a28fb218f64b3bf5d7; path=/;
HttpOnly\r\nDate: Mon, 23 Mar 2020 16:26:57 GMT\r\nLocation:
https://urist-expert24.ru/?calltouch_tm=yd_c%3Acam... Юр.Консультация&utm_content=cid|campaign_id|gid|gbid|aid|ad_id|adp|addphrases|dvc|device_type|pid|phrase_id|rid|retargeting_id|did|adtarget_id|pos|position_typeposition|adn|source_type|crid|creative_id|&utm_medium=cpc&utm_source=eLama-yandex&utm_term=keyword\r\nContent-Type:
text/html; charset=UTF-8\r\nCache-Control: max-age=0, must-revalidate, private\r\n\r\n\0\0\0\0\0\0\1\3\0\1\0\10\0\0\0\0\0\0\0e l», 952) = 952

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question