Forum Moderators: open

Message Too Old, No Replies

parent directory disallow

         

jason_m

3:16 pm on Mar 13, 2010 (gmt 0)

10+ Year Member



hello,

i am sure this is a simple question for a lot of you but here goes.

i have a site lets call it: example.com
i have a subdir called: images

i want to be able to access files in my: /images/headshot.jpg
but i do not want a user to be able to see what else i have in /images/*

not sure how this is done.
any help would be largely appreciated!

[edited by: incrediBILL at 5:03 pm (utc) on Mar 13, 2010]
[edit reason] Only use EXAMPLE.COM for sample domain names [/edit]

penders

5:25 pm on Mar 13, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



...but i do not want a user to be able to see what else i have in /images/*


How does a user see what else you have in your images subdir? Do you mean the user gets a 'directory listing' when they enter http://example.com/images/ in their browser?

If so, you can prevent Apache from generating a directory listing by putting the following in a .htaccess file either in your webroot (to affect every directory on your site), or in your images folder (if you just want to prevent directory listings in that folder).

Options -Indexes

penders

6:21 pm on Mar 13, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, that is a directory listing generated by Apache when there is no default file (eg. index.html) in that folder. See my post above to disable this.

jason_m

6:34 pm on Mar 13, 2010 (gmt 0)

10+ Year Member



great, thank you very much!