title: How can I allow to read a file only if you are trying to read it from a specific page?
body: <p>I would like to deny the access to some json files (for example, opening in the browser mysite.com/files/name.json have to return an error 403), but I want to allow a specific page to read these json files in a javascript fetch function.</p>
  <p>So I put an .htaccess in the folder where the json files are contained, and I tried to write this:</p>
  <pre><code>&lt;Files ~ &quot;^.*\.([Jj][Ss][Oo][Nn])&quot;&gt;
  order deny,allow
  deny from all
  allow from ^/lab/app/maker.js
  &lt;/Files&gt;
  </code></pre>
  <p>But it doesn't work and return an error 500. How can I say something like &quot;allow to read these files if the page that are trying to read is maker.js&quot;?</p>