Hello,
Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.
You can disable this redirection of media links by heading over to Rank Math > General Settings > Links > Redirect Attachments as shown below:
Let us know how this goes. Thank you.
Not good, cause when using ACF, and adding link field, the link is going automaticly to the media page, and not to the image itself.
With yoast, when using this feature, there is no problem and the PDF opens, but when I tried the same (I already tried what you wrote before opening this ticket) with your plugin, Instead of getting the PDF file, I got the media page…
Big problem guys
HI there,
Thanks for the follow up.
You can make use of the following code to change the redirect_url:
/**
* Redirect the attachment to its parent post.
*
* @param string $redirect URL as calculated for redirection.
*/
add_filter( 'rank_math/frontend/attachment/redirect_url', function( $redirect ) {
return $redirect;
});
I hope this info helps.
thanks for the quick fix, but this is something you should add into dev department for a permanent fix for all users guys,
In 99% of the installations, this is a must have.
Hello,
I am glad that this info proved useful.
I will log this as a suggestion for our dev team and hopefully this will be added to our future development roadmap.
Thank you.