E
E
EnnX2021-02-23 11:04:48
htaccess
EnnX, 2021-02-23 11:04:48

How to set up a server redirect for links in UTF-8 encoding?

Hello!
When configuring contextual advertising settings, Yandex Direct encountered a problem with displaying links in UTF-8 encoding: for example, a link to a client's website is displayed as https://yacht-arenda.ru/sochi%2Fprincess-grazia?yc... , when she is not working. "%2F" means "/".
Link to Yandex Direct documentation https://yandex.ru/support/direct/statistics/url-ta...

Question: what rule do I need to write in .htaccess for the advertising campaign to work correctly?
Thanks in advance for your replies!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2021-02-24
@dodo512

RewriteEngine On

RewriteCond %{THE_REQUEST} /([^?]+)%2F([^?\s]*) [NC]
RewriteRule ^  https://yacht-arenda.ru/%1/%2 [R=301,L,NE]

Or
RewriteEngine On

RewriteRule ^(.+)%2F(.*) https://yacht-arenda.ru/$1/$2 [R=301,L,NC,NE]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question