hlstriker Posted April 8, 2007 Share Posted April 8, 2007 Hi, I didn't know which forum to post this in, so I just came here. Does anyone know how to block web folders from people seeing the contents. Example: Someone goes to "www.mysite.com/FolderName/" they would be able to see all the content of that folder. I know you can put an index file in the folder to have it load that when they go to that folder, but is there a way to block it without adding the index? I also tried to chmod the folder only to 750, but that blocked all the content in the folders to. If anyone knows if this is possible and how to do it please let me know! Thanks Quote Link to comment https://forums.phpfreaks.com/topic/46076-blocking-web-folders/ Share on other sites More sharing options...
neylitalo Posted April 8, 2007 Share Posted April 8, 2007 Put this line in a file named .htaccess in the directory you want to prohibit file listings for. Options -Indexes Quote Link to comment https://forums.phpfreaks.com/topic/46076-blocking-web-folders/#findComment-223907 Share on other sites More sharing options...
MadTechie Posted April 8, 2007 Share Posted April 8, 2007 make a index file ie index.php or index.html when they goto that folder it will show the page not the contains Quote Link to comment https://forums.phpfreaks.com/topic/46076-blocking-web-folders/#findComment-223925 Share on other sites More sharing options...
ober Posted April 8, 2007 Share Posted April 8, 2007 make a index file ie index.php or index.html when they goto that folder it will show the page not the contains I love people that don't read the entire post before responding. And neylitalo, adding an .htaccess file takes just about as much work as adding index files. If it's your webserver, look up the manual. It will have an option to turn it off. If it's not your webserver, check your control panel or ask the host how to modify the settings. Quote Link to comment https://forums.phpfreaks.com/topic/46076-blocking-web-folders/#findComment-224576 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.