Hello,
You just need to enable the option called “Redirect Attachments” in the WordPress Dashboard > Rank Math plugin Dashboard > General Settings > Links section.
I have attached a screencast so you can see how to do it: https://i.rankmath.com/99j0F2
Looking forward to help you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Thanks. I have the feature enabled, but either it’s not doing as I would expect, or it’s not working.
In the sensitive data is an example blog post URL, and an example image URL from the blog post. I would expect the image URL to redirect to the post URL, but it doesn’t.
Cheers,
Ed
Hello,
WordPress creates a page with only the image for every image you upload to the website, it is called the attachment.
Since those pages are thin content (and for that reason, it is bad for SEO), it is usually a good idea to redirect them to the original post.
That is what this option does.
In your case, it seems you don’t want to redirect the attachments but the images themselves. To do that, you should use the Redirection module with a custom rule.
Hope it helps.
AH, yes, my language wasn’t clear enough, so thanks for clarifying the ask.
When you say ‘set up a custom rule’, would this be one rule to cover all instances, or a case of adding one rule per image?
Hello,
Thank you for contacting Rank Math today.
You would need to redirect each of the image links since each redirects to a unique post URL. You can also make use of a .htaccess redirection to redirect all the file links to a one destination such as your homepage.
Looking forward to helping you. Thank you.
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.