how to not show "hiding index of /blah/"

my site has a folder containing static images ie /images

when i hit the url site.com/images, i see my image listing! so i added indexingore* to the htaccess file in root to hide all listing..

but now when i hit site.com/images, i see

Index of /static

Name Last modified Size Description

Apache/2.2.14 (Ubuntu) Server at www.site.com Port 80

how can i not show this page? or redirect to a default page?

do i do a redirect in the htaccess file? but if i want to apply this to 10 other directories, does that mean i have to add a redirect for all those 10 directories?

2 Replies

indexignore is just telling it to not index those files- you want it to not generate an index at all, which is Options -Indexes .

Or you can put a generic index.html file in each directory.

For best practice, you should do this in your httpd.conf file.

Something like:

Options -Indexes FollowSymLinks MultiViews

Remember to apply this within tags.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct