raman Posted January 15, 2009 Share Posted January 15, 2009 I want the user not to see the index of my web directory, without creating a .htaccess file or a blank index.html file Please suggest. Quote Link to comment https://forums.phpfreaks.com/topic/140907-solved-hide-directory-index/ Share on other sites More sharing options...
trq Posted January 15, 2009 Share Posted January 15, 2009 The only thing you can do is switch it off in your httpd.conf file or VirtualHost directive if you have sufficient permissions to do so. Quote Link to comment https://forums.phpfreaks.com/topic/140907-solved-hide-directory-index/#findComment-737567 Share on other sites More sharing options...
raman Posted January 20, 2009 Author Share Posted January 20, 2009 The only thing you can do is switch it off in your httpd.conf file or VirtualHost directive if you have sufficient permissions to do so. Please explain how to do this. Quote Link to comment https://forums.phpfreaks.com/topic/140907-solved-hide-directory-index/#findComment-741012 Share on other sites More sharing options...
trq Posted January 20, 2009 Share Posted January 20, 2009 Place the following line within your httpd.conf file. Indexes off Quote Link to comment https://forums.phpfreaks.com/topic/140907-solved-hide-directory-index/#findComment-741027 Share on other sites More sharing options...
raman Posted January 21, 2009 Author Share Posted January 21, 2009 I tried to add the line Indexes off at different places in the httpd.conf file and then gave the command to restart apache but this gives an error: Invalid command 'Indexes', perhaps mis-spelled or defined by a module not included in the server configuration. Please suggest. Quote Link to comment https://forums.phpfreaks.com/topic/140907-solved-hide-directory-index/#findComment-741814 Share on other sites More sharing options...
corbin Posted January 21, 2009 Share Posted January 21, 2009 Options -Indexes Quote Link to comment https://forums.phpfreaks.com/topic/140907-solved-hide-directory-index/#findComment-741835 Share on other sites More sharing options...
raman Posted January 21, 2009 Author Share Posted January 21, 2009 Options -Indexes This also did not work, can you tell where exactly to add this line in httpd.conf ? Quote Link to comment https://forums.phpfreaks.com/topic/140907-solved-hide-directory-index/#findComment-741846 Share on other sites More sharing options...
corbin Posted January 21, 2009 Share Posted January 21, 2009 Well settings in httpd.conf are applied in the order of the file, so at the end if you want it to apply to all files. You might also want to put it in a <Directory> statement. Quote Link to comment https://forums.phpfreaks.com/topic/140907-solved-hide-directory-index/#findComment-741852 Share on other sites More sharing options...
raman Posted January 21, 2009 Author Share Posted January 21, 2009 Thank you, this worked. I used the following: <Directory /usr/local/apache2/htdocs/bladirectory > Options -Indexes </Directory> I want to be able to see the index locally on my machine or from any machine on my network, what more should I add in this ? Quote Link to comment https://forums.phpfreaks.com/topic/140907-solved-hide-directory-index/#findComment-741978 Share on other sites More sharing options...
corbin Posted January 21, 2009 Share Posted January 21, 2009 It won't be worth the effort. But if you really want to do it, you could probably do it with an IfDefined SetVar and maybe some other stuff. Quote Link to comment https://forums.phpfreaks.com/topic/140907-solved-hide-directory-index/#findComment-742689 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.