I’m working on developing a javascript framework and I don’t want anyone to be able to link to the “nightly build” .js file directly on the server.
Based on my research from google, here’s what I have in my htaccess:
<FilesMatch /development/flanvas/flanvas.js>
ForceType applicaton/octet-stream
</FilesMatch>
And I’ve also tried putting a .htaccess file in /development/flanvas/ and adding:
AddType applicaton/octet-stream.js
Neither have worked so far 🙁
*edit
I suppose if a user really wanted to snag this, they could curl/ajax it. Is it advised to have the .htaccess check the HTTP_REFERER instead? This could potentially get two birds with one line..
Is the root of your server really the DocumentRoot for the website?
i.e. is /development/flanvas/flanvas.js the absolute path to the JS file on your machine?
I would try
or
Hope this helps