We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26971
    • 3 Posts
    Hi first time poster smiley

    I have modx evo installed/configured and I have a secure section on my site with web logins working great. I however have a problem with a PDF file I want only accessible with these user behind the secure pages.
    I set up a web link linking to the file but the problem is anyone not logged in can go to the direct URL
    eg. www.example.com/modx/assets/files/pdf/document.pdf

    I have tried setting htaccess on this directory but obviously it asks for htaccess password even when logged into modx. Also tried this plug in UsersToHtpasswd, thinking it might sync user passwords and wouldn’t prompt. Didn’t work.

    Have tried using modx rev using static resources but same problem.

    Is there anyway I can completely protect direct URL access, but logged in modx user have access?

    Any insight would be very helpful
    Thank you
    Shazzed

    Edit: modx evo 1.0.3 , apache webserver
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Either store the .pdf files outside of the web space and use a snippet to generate a download, or store the .pdf files as BLOBs in the database and again use a snippet to generate the download.

      Here are a few other options:
      http://modxcms.com/extras/package/147
      http://modxcms.com/extras/package/148
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 26971
        • 3 Posts
        Thanks sottwell perfect!
        Went with the first option worked great cool

        Thank you for your reply.
        Cheers
        Shazzed