jeudi 3 septembre 2020

deny directly access files from url address bar but allow js and html to use it

I have some files in my web.

web
  | 
  index.html
  .htaccess
  |
  folder 1
  |      |
  |      a.json
  |      b.html
  |      c.json
  |
  folder 2
  |      |
  |      d.json
  |      e.html
  |      f.json
  ......

How should I manipulate .htaccess so that others cannot directly access my json files from the url address bar
(For examle: www.myweb.com/folder 1/a.json)
but allow js and html to use the json files? When I try to add deny access in .htaccess, I denied all therefore index and js are also not able to access the json files.




Aucun commentaire:

Enregistrer un commentaire