Switch from Yoast: Media attachment pages erroneously redirect to home page

#68281
  • Resolved Xsel Labs
    Rank Math free

    I’m switching from Yoast to RankMath. We have many links to PDFs on our website where we’ve linked to the media attachment page instead of the media link. Yoast automatically redirected those media attachment page links to the media files. Since switching to RankMath, my media attachment pages now redirect to my Home Page, which is a big problem!

    I searched for solutions and tried adding this filter to my functions.php file:
    https://rankmath.com/kb/filters-hooks-api-developer/#change-redirect-url

    However, even with that added, I still have the problem. All my media attachment pages redirect to my home page.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Update: I enabled Advanced mode and found and disabled this setting: Rank math > General settings > Links > Redirect Attachments. Now my PDF links are going to their attachment pages instead of the home page. However, I’d still like help with this filter:

    https://rankmath.com/kb/filters-hooks-api-developer/#change-redirect-url

    I expected it to redirect my media attachment page to the media file, but it isn’t doing this.

    I gave up and (hopefully) changed all my links manually.

    Alberto
    Rank Math business

    Hello,

    Thank you for contacting Rank Math today.

    I am sorry for the issues you had but I am happy you were able to solve it. If you have any other issues or questions in the future, just let us know.

    Looking forward to helping you. Thank you.

    ​​​​​​

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

You must be logged in to reply to this ticket.