N
N
Nikita2018-11-03 11:12:44
htaccess
Nikita, 2018-11-03 11:12:44

Why does the redirect not work if utm is present?

Hello! Changed the url of the site pages (Wordpress - Settings - Permalinks). Without utm tags the redirect works, with them it doesn't. How can this be fixed?
The site now has redirects of the type from site.ru/blog/rubilniki/ to site.ru/rubilniki/
And in the advertising campaign there are links with old addresses and such utm tags: site.ru/blog/rubilniki/?yclid=7675632334534. Now when I click on this link, it says: page not found. If I remove utm then the redirect works.
Question: is it possible to create a rule in htaccess so that the redirect also works with utm tags? At least for utm yclid ? Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita, 2018-11-03
@MrNix21

So far I've decided this:

RewriteCond %{QUERY_STRING} ^yclid
RewriteRule ^(.*)$  http://%{HTTP_HOST}/$0? [R=301,L]

Of course, this is not entirely true, since in this case the utm is not saved. But at least the redirect works, it's already good. Maybe someone knows how to make sure that utm is also saved when redirecting? Those. to make it so - redirect from site.ru/blog/rubilniki/?yclid=7675632334534 to site.ru/rubilniki/?yclid=7675632334534 with utm saved.

L
leoner, 2018-11-06
@leoner

Why save utm tag in redirect? After all, the server receives information with the address of the page where the redirect comes from.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question