• Resolved pymsh

    (@pymsh)


    Hi

    I uploaded images to wordpress. then I used the images in product page so used them in the product gallery. for instance I have an image like this with the URL:

    https://lelika.se/wp-content/uploads/2025/02/Photo_lelika-scaled.webp

    and the product page is: https://lelika.se/klassiskt-smyckeskrin-i-vit/

    I activated redirect attachment to the post they appear in but it does not work and still clicking on the image URL ends up in a single image page.

    I added seevral PHP codes but they all failed the redirection. In every change I made sure that I empty the cache, save resave the permalink, checked the htaccess and there is no other redirect rules but still this is not working. Is there a solution to fix it or it is the normal behavior?

    Kind Regards

    Pym

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pymsh

    (@pymsh)

    Hi again

    It worth mentioning that some of the images that are already in a product page when checked they are redirected to the home page!!! The setting that says the orphan attachment should be redirected to a new destination is activated and for my site it is redirecting to the home page. but again why would some of the images when I click on their URL open in a new page with nothing but an image while some others are redirected and treated as orphan attachments!

    Kind Regards

    Pym

    Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @pymsh,
     
    Thank you for contacting Rank Math support.
     
    Please note that the Redirect Attachments option redirects the attachment pages, not the image URLs. The attachment pages are generated by WordPress for every file you upload to the media library. You can check this guide to learn more: https://rankmath.com/kb/should-you-redirect-attachments/
     
    You can’t redirect the image URLs using our plugin, as they are served directly from the server. You will have to get in touch with your host and ask them to help you set up server-side redirects to redirect the image URLs.
     
    Please do not hesitate to let us know if you need our assistance with anything else.

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

The topic ‘Redirect Attachments does not work as expected’ is closed to new replies.