seeya Posted December 7, 2007 Share Posted December 7, 2007 let's say my site is in www.myhostname.com/test/index.php how do i block ppl from seeing the files i have in test folder? all files i am doing are in localhost.. since its a project for my school.. Link to comment https://forums.phpfreaks.com/topic/80605-block-directory/ Share on other sites More sharing options...
thebadbad Posted December 7, 2007 Share Posted December 7, 2007 Do you want to password protect the folder? If so, you could use mod_rewrite (Apache). If that doesn't ring a bell, google something like htaccess password. Link to comment https://forums.phpfreaks.com/topic/80605-block-directory/#findComment-408811 Share on other sites More sharing options...
PHP_PhREEEk Posted December 7, 2007 Share Posted December 7, 2007 If there is an index.php or index.html, the folder contents will not be displayed. If you don't want anyone accessing your index file, you will need to do a HTTP Auth through .htaccess and require a login for that folder. Once you are logged in, you should be able to use it at will until you close out that browser and open a new one. You'd then have to re-login. PhREEEk Link to comment https://forums.phpfreaks.com/topic/80605-block-directory/#findComment-408816 Share on other sites More sharing options...
seeya Posted December 7, 2007 Author Share Posted December 7, 2007 i've tried in on my localhost (my laptop) it doesnt work. i've created 2 files, .htaccess and .htpasswd in .htaccess, i have the following code. AuthUserFile C:\Apache Group\Apache2\htdocs\vestito10\.htpasswd AuthType Basic AuthName "My Secret Folder" Require valid-user in .htpasswd, i have the following. fred:p29cmnwl4a0et is there anything wrong? Link to comment https://forums.phpfreaks.com/topic/80605-block-directory/#findComment-408843 Share on other sites More sharing options...
thebadbad Posted December 7, 2007 Share Posted December 7, 2007 I think you need to enclose your password file path with double quotes: AuthUserFile "C:\Apache Group\Apache2\htdocs\vestito10\.htpasswd" The space in the path messes things up otherwise. Link to comment https://forums.phpfreaks.com/topic/80605-block-directory/#findComment-408861 Share on other sites More sharing options...
seeya Posted December 7, 2007 Author Share Posted December 7, 2007 I think you need to enclose your password file path with double quotes: AuthUserFile "C:\Apache Group\Apache2\htdocs\vestito10\.htpasswd" The space in the path messes things up otherwise. hm.. it still doesnt work Link to comment https://forums.phpfreaks.com/topic/80605-block-directory/#findComment-408873 Share on other sites More sharing options...
peranha Posted December 7, 2007 Share Posted December 7, 2007 What Web server are you using? is it apache, IIS Link to comment https://forums.phpfreaks.com/topic/80605-block-directory/#findComment-408877 Share on other sites More sharing options...
seeya Posted December 7, 2007 Author Share Posted December 7, 2007 What Web server are you using? is it apache, IIS apache Link to comment https://forums.phpfreaks.com/topic/80605-block-directory/#findComment-408883 Share on other sites More sharing options...
peranha Posted December 7, 2007 Share Posted December 7, 2007 # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All Look for this in your httpd.conf file and change AllowOverride to All, it is defaulted to NONE. Link to comment https://forums.phpfreaks.com/topic/80605-block-directory/#findComment-408888 Share on other sites More sharing options...
tbare Posted December 7, 2007 Share Posted December 7, 2007 in my .htaccess file, i have this line: AddType application/x-httpd-php .html at the end... try adding it? Link to comment https://forums.phpfreaks.com/topic/80605-block-directory/#findComment-408960 Share on other sites More sharing options...
seeya Posted December 12, 2007 Author Share Posted December 12, 2007 # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All Look for this in your httpd.conf file and change AllowOverride to All, it is defaulted to NONE. this is not in my httpd.conf in my .htaccess file, i have this line: AddType application/x-httpd-php .html at the end... try adding it? it doesnt work Link to comment https://forums.phpfreaks.com/topic/80605-block-directory/#findComment-412738 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.