dynamic link to pdf doesn’t work again

#207514
  • Resolved Günter Auch
    Rank Math business

    Hi Support Team,

    I need this to be solved very quickly cause it is a live system of my customer.
    Sorry for making stress and thank you for a quick support!

    Following to the other support ticket – which is closed – I have the same problems again. I have created in Divi a button which links to a pdf. But now – after a click on that button – instead of downloading the pdf I get redirected to the WordPress Dashboard. In the support ticket before we solved that problem by enabling the attachment in Rank Math and adding following code into the child themes’ function.php:

    // RankMath pdf link
    add_filter( ‘rank_math/frontend/attachment/redirect_url’, function( $redirect, $post )
    {
    return $post->guid;
    }, 10, 2 );

    I also clicked “Save” at the WordPress permalinks settings.

    So we solved that problem at the development system. Today I took care for the productive system: I updated WordPress, themes and all plugins. And then I installed RankMath, which caused the problems with the Download buttons!

    The next very surprising thing is, that I uploaded 3 pdf files today and created buttons with a dynamic link to the pdf files – these buttons are working. But pdf files which I have uploaded some months ago and which are also linked via dynamic link into a button don’t work…

    So please help me – I don’t know what happens.

    Here the working buttons with the new uploaded pdf files:
    https://devicemaster.eu/de/news/
    (the first three buttons “Download PDF”)

    And here the buttons which don’t work:
    https://devicemaster.eu/de/klinische-konformitaet/
    (the buttons with “Download Flyer…”)

    Best regards,
    Günter

Viewing 9 replies - 1 through 9 (of 9 total)
  • Brian
    Rank Math free

    Hello

    Thank you for contacting Rank Math today.

    Upon checking your site, I can not see where you have inserted the code I shared with you last time. You seem to have the theme editor hidden. Is it possible for us to check it with your FTP credentials?

    If so, please provide them in the sensitive data section.

    We are looking forward to helping you.
    Thank you.

    Günter Auch
    Rank Math business

    Hi Brian,

    I have created a FTP user. I added the code into the functions.php of the Divi child theme. The FTP user is linked direct to the child theme directory.

    Best regards,
    Günter

    Hello,

    I have accessed your FTP but it doesn’t list all your server’s directory there – its empty. Could you please check it so we can further investigate this issue?

    We are looking forward to helping you.

    Günter Auch
    Rank Math business

    Hi Jeremy,

    I thought you just need an access to the functions.php. Now the ftp user has the access to the root directory.

    Best regrds,
    Günter

    Günter Auch
    Rank Math business

    Probably you just recognized following: it is a problem with the permalinks after the installation of RankMath. I had a look at the pdf files. All pdfs which have been uploaded this year in 2021 are working correctly. But the permalinks of all pdf files uploaded in the years before don’t work anymore…

    Günter Auch
    Rank Math business

    Due to the fact that the problems affect my customers website which is online, I have replaced all pdf files except two on the page which I mentioned above:

    https://devicemaster.eu/de/klinische-konformitaet/

    I replaced the pdfs with a plugin and the parameters: change file name and links to the file. Because I replaced the pdf with a copy of itself with the same file name all links to the pdf and the permanent links didn’t change. But now they work as a dynamic link in a divi button…

    But please have a look at the two links which I didn’t change and which still dont’ work.

    Thank you.

    Hello,

    Thank you for your patience.

    Since you have already found a workaround, you can apply that to the remaining PDF files for now.

    However, we will find a suitable solution for you in the future for these PDFs to work and we will let you know.

    We would really appreciate your kind patience regarding this matter.

    Thank you, and please don’t hesitate to contact us anytime if you need further assistance with anything else.

    Günter Auch
    Rank Math business

    Hello Reinelle,

    I was thinking about buying the RankMath Business Plan because your plugin brings a lot of useful features. But every time I’m thinking of the Business Plan I hold back because of this issue.

    I know – I have a workaround for the pdf files, but this does not give me the safety that everything works fine with RankMath. I also know that I’m using the free version and that your support has to take care also for clients which bought the RankMath plugin.

    I’m torn between buying and not buying – so, if you could solve the problem it would lead me to your Business Plan…

    Thank you and best regards,
    Günter

    Brian
    Rank Math free

    Hello.

    Thank you for getting back to us.

    Upon further investigation of your issue here, I was able to fix this issue. Here are some steps I carried out:

    First I changed the code a little bit by removing the priority. However, this did not have that much effect as it was still behaving the same.

    Secondly, I replace the files on that page with other PDF files and they worked. Therefore I concluded that the issue must be the actual files themselves and not anything to do with the redirection.

    Lastly, I went ahead and renamed both of these files by shortening them up to their initials CER & MDR. Thus, the filename of these PDF files now appears shorter.

    This issue could be happening if there is a possible conflict of the links, perhaps you have other files named that way in your file manager. Or simply you should not use lengthy filenames that have any other special characters within them.

    All in all, you can go ahead and confirm from your end if the PDF files are redirecting accordingly as you wish.

    Hope this helped. Please let us know if you have any other questions.
    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.

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

The ticket ‘dynamic link to pdf doesn’t work again’ is closed to new replies.