Reputation: 6722
I have a (Wordpress powered) website, and Google is indexing some of the sub-directories. How can I stop Apache from showing users the directory listing? I know I can edit .htaccess to password-protect a directory, but I would prefer a 403 / custom redirect if possible.
Upvotes: 3
Views: 472
Reputation: 140060
You need this entry in your .htaccess
file:
Options -Indexes
Upvotes: 12
Reputation: 2849
Don't know much about Apache but you should do a 404 instead of a 403 if you can because a 403 tells someone that they may have found something interesting.
Upvotes: -2
Reputation: 33455
Look at your robots.txt rules, and make sure apache is not serving-up directory listings.
see http://httpd.apache.org/docs/2.0/howto/htaccess.html && http://www.webmasterworld.com/forum92/5272.htm
Upvotes: 3