PDA

View Full Version : deny direct URL access to a file



aviram
09 Jun 2011, 11:22 AM
Hey. I had a search and couldn't find what I am looking for. I have a PHP file which has a javascript link to a .js file:

<script type="text/javascript" src="js/edit.js"></script>
I use this instead of just putting the code inside the tags because I want to keep the code concealed. Therefore my work is not done because a user can still access the .js file directly from the URL.
So is there any way to block the user from reading the file directly, but allowing the browser access it? It must be with the .htaccess file but I couldn't find the way. Thanks:kiss: