Follow-Up: Redirect an url with utm query parameter and add additional parameter

#486193
  • This is a follow up on ticket #377709
    https://support.rankmath.com/ticket/redirect-an-url-with-utm-query-parameter-and-add-additional-parameter/

    Hi again 🙂
    Its been a while and this issue is not yet fixed. Nothing to blame rankmath for, just to mention that I did a retest 😉 We recently ran into this again and this might be an important note for you, because it will **possibly break a lot of websites since a few weeks and more to come soon**.

    I have the setup mentioned in this ticket. Now I link to this url in my instagram and facebook stories. This worked really well until a few weeks ago. Now facebook adds a query parameter to each url like so: /link?​fbclid=​P.​.​.​uTMIF5u6tmEkr36iUmezXBJ3EU3ISl055Xko

    This results in a redirect /destination?param=true?​fbclid=​P.​.​.​uTMIF5u6tmEkr36iUmezXBJ3EU3ISl055Xko which is of course invalid. So now a lot of my website links are broken. I know the reason for that is also facebook, so we could blame them. But they will very unlikely change the behavior and in any case fixing it in rankmath would make sense.

    So if you can have a look at this issue again, that would be really helpful.

    Thanks and have a very nice and sunny day 🙂

    Cheers!
    Nico

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello,

    Thank you for contacting raising your concern about the bad redirection of a URL with query parameters to another URL with query parameters.

    I have asked a developer to check if there are any changes that can be made.

    We’ll let you know if there is any improvement.

    Thank you.

    Hello,

    Our plugin has included support for query parameter redirects recently so make sure that you are using the latest versions of the plugin.

    If you set the source URL with the query parameter and then add the destination without the query parameter our plugin will still pass the correct query parameter to the destination.

    Also, if you are using multiple params in the destination you can simply add the parameters manually and remove our automated way of adding the parameters by adding this filter: https://rankmath.com/kb/filters-hooks-api-developer/#redirect-remove-query

    Don’t hesitate to get in touch if you have any other questions.

    Hello Miguel,
    thanks for your reply. I am using RankMath Version 1.0.102.1 but for me nothing has changed. If I append a query string to the url to redirect, then it will be appended to the destination. But if there is already a query parameter, it will not get merged correct like so:

    /link?new_param=test

    /destination?variable=3?new_param=test

    But it should rather be:
    /destination?variable=3&new_param=test

    So why doesnt it work for me?

    Hello,

    Can you please share a screenshot of the redirection rule you have created for that certain URL? You may upload the screenshot to https://imgbb.com and share the URL here.

    You may also share a sample URL so we can try replicating the issue on our end as well. You may insert all these details in the sensitive data section.

    Looking forward to helping you with this one.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    I’ve added a screenshot and a test url 🙂

    Hello,

    As stated in a previous reply, you will have to disable the passing of query parameters in redirections, then manually add the query parameter to the destination URL. You can refer to this guide for how to add a filter: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    
    add_filter( 'rank_math/redirection/add_query_string', '__return_false' );
    

    Settings:
    Redirect source
    /rankmath-test?test=1

    Redirect destination
    https://yourdomain.com/category/fun?latest

    Hope that clarifies things. Please let us know if you have questions.

    Alright, so this is one workaround. But this also disables passing query parameters globally. Why dont you just implement a merge strategy? This shouldnt be so hard, or am I missing something?

    With the new instagram change a lot of users might be affected, but they dont even know the reason, as it needs technical understanding and debugging to find the issue.

Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this ticket.