We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1953
    • 8 Posts
    Newbie here...

    I have certain files (pdfs mostly) that I only allow access to via login of webusers. But I just noticed that if any pdf is loaded from anywhere on my site, someone can easily get in to entire assets/files directory and see everything. Is there a way to disable this type of access?
      • 25663 MODX Staff
      • 12,272 Posts
      Do you mean it shows the directory index when you enter your example.com/assets/files/ into your browser address bar? If so turn off the directory index in Apache.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 1953
        • 8 Posts
        Could you walk me through this...again, Newbie. Thanks.
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: apryls at Sep 17, 2009, 05:06 PM

          Could you walk me through this...again, Newbie. Thanks.
          If you have the ability to use .htaccess, simply put an .htaccess file in assets/files/ with the content:
          Options -Indexes

          Note however, that if someone knows the name of the file they will still be able to access it directly.