Redirection of encoded URLs

  • RankMath “does not care” about encoded URLs and made a loop redirection. Im from Romania, and we have some URLs with diacritics like ț, ș, â, ă, î. We dont use anymore this characters in URLs but the old ones need 301 redirection. With Yoast there was no problem, with htaccess same, no problem. But Rank Math is missing something!

    Can you advice me how to redirect this encoded URLs?

    Let me give you an example. If I copy this URL from Google Search Console, and paste it in Chrome or Mozilla Firefox, it looks like this:șamanice-ale-vrajitoriei/

    But, in one second it is changed in this, just before to access it:

    You can see that %c8%99 means the ș character? If I put in redirection manager the first one, and redirect it to the actual URL of that post: it does not work. If I put the second one, it is working but only for me logged in administration. If I`m logged out it shows me a redirection loop of to the same

    Please, I come back again with this issue because last year Michael Davis told me that:

    <blockquote>Hi there,

    Thanks for the response.

    I have just raised this issue with our dev team for closer investigation and we will be getting back to you in a short while.

    We appreciate your patience.</blockquote>

    And af course, he never came back and the ticket was automated closed after 15 day because I do not reply? To reply to what? I`m not with the empathy. I communicate with the mind because there I have the knowledge! So please, investigate and bring an update. I loose from last year hundreds of URLs position on Google Search because when I switch from Yoast to RankMath this was a very huge issue that other plugin helped me to have it fixed until the switch!

Viewing 7 replies - 1 through 7 (of 7 total)
  • HI Bogdan,

    Apologies for the delay in getting back to you on your previous ticket.

    I can suggest that you take a look at the following encoding syntax that we use when converting special characters in the URLs

    You can use the same syntax when your URL contains a special character.

    Let me know if you have additional questions.

    You do not understand me. This is the encoding that I use, but the module resolve the encoding and show me in the table of redirections the URL with the normal characters. Then if I try the URL in browser, logged in, the redirection work, but if I logged out then I get a loop redirection because there is an issue! The loop redirection it is on the destination URL WOTHOUT diacritics characters! So that means that the redirection module encode the URL back and in the process do not make differece between the one with character encoded or not. Come on, this is an issue not a normal behavior!

    Try in your backend to create a fictive redirection of a page that have the url that I give to you. See for your self. I tryit already on other domain with other system and RankMath do the same.

    You understand me or my english is chinese? I speak english but it is not my mother languadge. because that I ask, maybe I do not explain to be undestood good.

    Hi Bogdan,

    Thank you for the reply.

    I am sorry that some meaning had been lost in translation. I have now been able to replicate this problem on my end and this has been submitted to our dev team for closer investigation.

    We will be getting back to you in a short while.

    Thank you!


    I am not sure why it isn’t working for you but it seems to be working fine for me:

    Can you please share the config of the redirect that isn’t working for you?
    Source URL:
    Target URL:

    We look forward to helping you diagnose this further.

    Thank you.

    Hi Todd,

    I will give you an example.
    Thesource: elementele-%C8%99amanice-ale-vrajitoriei
    Thetarget: elementele-samanice-ale-vrajitoriei

    I test it on my website with all the plugins deactivated to see if there it is an influence. It was the same effect. What I observe it is that when I am logged in and testit, the redirection works, but when I am logged out, it does not.
    I test it on other website that has rank math but not nginx/apache/varnish like mine, but only apache. The same loop redirection issue. I test it on a website that user Yoast SEO premium and there was no loop redirection issue. What I can see also it is that on Yoast redirections manager, the encoded URL remain encoded in the table, but on RM redirection manager it is resolved.
    There had to be an bug on the code where the sanitized of the source URL start. Maybe this will help you:


    ‘protected function normalize_redirects( $redirects ) {
    $normalized_redirects = array();

    foreach ( $redirects as $origin => $redirect ) {
    $normalized_redirects[ rawurldecode( $origin ) ] = $redirect;

    return $normalized_redirects;

    If you can stop the decoding of the source URL and let it encoded in all the redirection steps it will be best.

    Hi Bogdan,

    It seems to be working fine for me:

    Here it is when I am logged out:

    I am not sure how to replicate the issue.

    I have still gone ahead and shared this with the dev. team. If there is an issue, we will update you.

    Thank you.

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

You must be logged in to reply to this ticket.