1

I have multiple dynamic directories that I want to prevent the user from accessing, but I'd like the server to load those files.

My structure is as follows but does grow dynamically so I can't statistically name the files:

  • views/mods/headers/john/
  • views/mods/headers/john/meta/screenshot.png
  • views/mods/headers/john/index.html
  • views/mods/headers/john/style.css

How do I provide access to the folder john for the server and not a user trying to view it directly?, as well as screenshot.png, index.html and style.css?

Fairly new to Node so I'm not that sure, but in .htaccess it would be something like this: (htaccess) How to prevent a file from DIRECT URL ACCESS?

Thanks.

Community
  • 1
  • 1
DennisTurn
  • 139
  • 2
  • 12
  • Probably this can help. [prevent direct access to html page in node js](http://stackoverflow.com/questions/26293380/prevent-direct-access-to-html-page-in-node-js) – Dennish Jose Jan 19 '17 at 06:26

0 Answers0