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. 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 Link to comment https://forums.phpfreaks.com/topic/225288-restrict-dir-access/#findComment-1163472 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.