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.. Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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.