Arty Ziff Posted January 22, 2011 Share Posted January 22, 2011 Is there a way to restrict access to directories to scripts located on the same server? For example, I have some libraries. I don't want hackers to find them and perhaps use them, for example my pdf library. Quote Link to comment https://forums.phpfreaks.com/topic/225288-restrict-dir-access/ Share on other sites More sharing options...
requinix Posted January 22, 2011 Share Posted January 22, 2011 If you don't want somebody directly accessing a file, don't put it anywhere under the web root. ...unless the folder is well-protected, like with a .htaccess and Order allow,deny # default behavior is to deny access or (not as good) RewriteEngine On RewriteRule ^ - [R=404] # or redirect to your error page Quote Link to comment https://forums.phpfreaks.com/topic/225288-restrict-dir-access/#findComment-1163472 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.