Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter dberdal

    (@dberdal)

    P.S. I guess it’s working in the sense that the link above does redirect to my homepage… but if you copy/paste the link into your browser you can still download the file.

    I was hoping that it would only be downloadable if linked on my site.

    Plugin Contributor Barry Kooij

    (@barrykooij)

    Hey there,

    The ‘hotlink protection’ feature by default only blocks if another website is linking to your download. If a user enters the URL in the browser there is no referrer at all (so not hot linked), this is why this works by default.

    However, this behavior can be changed. Add the following code to your theme’s functions.php to also block empty referer:

    
    add_filter( 'dlm_hotlink_block_empty_referer', '__return_true' );
    

    Kind Regards,

    Barry Kooij

    kjm44

    (@kjm44)

    I’ve just put that code in my functions.php file and it is not working. I am still able to download a pdf if I cut and paste the link directly into a browser. I have the download set up properly and the download link is blocked successfully, but not the attached PDF file.

    e.g. https://website/download/6474/ is blocked but the link to the PDF is not.

    This important, please help.

    • This reply was modified 7 years ago by kjm44.
    kjm44

    (@kjm44)

    My apologies, I have worked out what I was doing wrong and it is all working perfectly now.

    Great plugin! Thank you.

    Thread Starter dberdal

    (@dberdal)

    Worked as expected, thanks a lot! I think a decent number of people would use this feature if it was added to the UI.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Prevent Hotlinking’ is closed to new replies.