i am a noob in htaccess so i want some help please !
i want to deny access to a js file if it is opened ftom the url bar ex ( when i type http://mysite.com/js/jquery.js in the address bar – i get a 403 ) but when the site is rendered by the browser it is downloaded to the browser normally .
for the moment i was trying this
<Files ~ "(.js|.css)">
Order allow,deny
deny from all
</Files>
but this prevents the browser to use the css and the js so i want to make a kind of rule to let the browser but not anyone directly from the url . can in this case use the referer or the host or something like this ?
(note : i don’t want to prevent the clients from viewing the js code because they could do it anyway but i have my reasons)
This would be the same as preventing image hotlinking. See http://altlab.com/htaccess_tutorial.html.
i.e: