Jump to content

Archived

This topic is now archived and is closed to further replies.

play_

Chmod help

Recommended Posts

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.jpg

so 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 13
Could 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.

Share this post


Link to post
Share on other sites
Hej

put "IndexIgnore *.gif *.jpg" in your htaccess file to block listing of image files.

WW.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Turn off Apache's indexing:

[code]
<Directory />
    Options -Indexes
</Directory>
[/code]

Share this post


Link to post
Share on other sites
just create an .htaccess file in your images folder with:

Options -Indexes

in it, and people will no longer have access to your images folder in list view.

Share this post


Link to post
Share on other sites
Thanks guys.

Effigy, I would prefer not to turn off apache's indexing, because there might be folders I would want to allow indexing

Share this post


Link to post
Share on other sites
Just use [code]<Directory /images>
    Options -Indexes
</Directory>[/code] instead then.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.