Canonical URL points to a 404 page

#535117
  • Resolved Eddie
    Rank Math free

    Hello,

    Strange issue after updating a canonical url – after updating the CORRECT url in the canonical url field, and then refreshing the page, the link changes and canonical url points to a 404 page.

    I have tested it on many pages and made sure I have copied the Correct url.

    I think it could be related to the fact my link is in Hebrew.

    Here is a short video so you could easily understand the issue:
    https://1drv.ms/v/s!AqEf9YmEgv4rg5h8VroF6yIiE7U-rA?e=bbmlBX

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

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    For us to easily debug the issue could you please put in the sensitive data section, the canonical you are trying to set on the page and the actual canonical that then goes to a 404 page?

    Looking forward to hearing back from you.​​​​​

    Eddie
    Rank Math free

    Hello,

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

    Thank you.

    Hello,

    Looking at the canonical that you are trying to set on the page it seems that you are adding a URL with spaces in it. Could you please confirm this?

    We tried to decode the URLs and it seems that the only character getting stripped is a single one that turns the permalink into words with spaces.

    Looking forward to hearing back from you.

    Eddie
    Rank Math free

    Hello,

    I can’t confirm it. I have rechecked the url I provided and I don’t see any spaces in it.

    It also happens to other url I am trying to set as canonicals on different pages (I can provide examples if needed).

    Eddie
    Rank Math free

    Is there any solution for this problem?

    Hello,

    We deeply apologize for the delay in response.

    We have shared this ticket with our developer to check the issue further. We should get back to you shortly with some advice.

    We appreciate your time and patience with this one.

    Hello,

    We were able to reproduce the issue on our setup and have logged it. Please allow us some time to test and release a fix. It should be added in the upcoming update.

    For now, to fix the issue on your site, please replace the following line here: https://github.com/rankmath/seo-by-rank-math/blob/master/includes/rest/class-sanitize.php#L65

    with:

    
    case 'rank_math_canonical_url':
        $sanitized_value = esc_url_raw( $value );
        break;
    default:
    

    Since the Canonical URL is stored with the wrong format on your site, you’ll have to remove it and update the Post again.

    I hope that helps. Please let us know if you need any further assistance.

    Eddie
    Rank Math free

    Hello Pratik,

    I have just updated to the last version but the issue wasn’t resolved after the update (I did delete the link and updated it again).

    Hello,

    Apologies for the inconvenience.

    The fix for this issue is not yet available with the latest version of the Rank Math plugin.

    However, our developers are already working on it to be included in the next update.

    We would really appreciate your kind patience regarding this matter.

    Thank you.

    Hello,

    Thank you for your patience.

    Just a quick update that we have fixed this issue on our recent release.

    Please update Rank Math & all other plugins, themes and WordPress to the latest version.

    The issue should be fixed.

    If not, please feel free to open a support topic or reply to this message and we will be more than happy to assist.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘Canonical URL points to a 404 page’ is closed to new replies.