play_ Posted September 21, 2006 Share Posted September 21, 2006 Probably not the right forum, sorry.Say i have this site:http://example.com/The main logo image, is located in http://example.com/images/logos/Anyone using firefox can right-click the image and select 'view image', opening the image in the browser with the full url on the address bar, like so:http://example.com/images/logos/someimage.jpgso if the person deleted 'someimage.jpg' from the address bar, he will be in "http://example.com/images/logos/" viewing all of its contents.How can i stop that? i set chmod to 711, but then index.php will give me this error:[quote]Warning: opendir(./images/logos/): failed to open dir: Permission denied in /hsphere/local/home/me/example.com/includes/classes.php on line 13Could not open directory for main image selection.[/quote]classes.php is where i have the script to open and select a random image from the logos folder.I would post my actually site here, but then people could navigate through my files, and i'd rather not let that happen.I will gladly PM it if needed.Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/21494-chmod-help/ Share on other sites More sharing options...
warewolfe Posted September 21, 2006 Share Posted September 21, 2006 Hej put "IndexIgnore *.gif *.jpg" in your htaccess file to block listing of image files.WW. Quote Link to comment https://forums.phpfreaks.com/topic/21494-chmod-help/#findComment-95857 Share on other sites More sharing options...
play_ Posted September 22, 2006 Author Share Posted September 22, 2006 Thanks for the reply.I did that, but now the main page does not get the image from the logo directory. so www.example.com, the image won't show. Quote Link to comment https://forums.phpfreaks.com/topic/21494-chmod-help/#findComment-96455 Share on other sites More sharing options...
effigy Posted September 22, 2006 Share Posted September 22, 2006 Turn off Apache's indexing:[code]<Directory /> Options -Indexes</Directory>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/21494-chmod-help/#findComment-96464 Share on other sites More sharing options...
sKunKbad Posted September 22, 2006 Share Posted September 22, 2006 just create an .htaccess file in your images folder with:Options -Indexesin it, and people will no longer have access to your images folder in list view. Quote Link to comment https://forums.phpfreaks.com/topic/21494-chmod-help/#findComment-96489 Share on other sites More sharing options...
play_ Posted September 22, 2006 Author Share Posted September 22, 2006 Thanks guys.Effigy, I would prefer not to turn off apache's indexing, because there might be folders I would want to allow indexing Quote Link to comment https://forums.phpfreaks.com/topic/21494-chmod-help/#findComment-96787 Share on other sites More sharing options...
Daniel0 Posted September 22, 2006 Share Posted September 22, 2006 Just use [code]<Directory /images> Options -Indexes</Directory>[/code] instead then. Quote Link to comment https://forums.phpfreaks.com/topic/21494-chmod-help/#findComment-96791 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.