Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

What Apache directive would be appropriate to prevent browsers and spiders from exploring css, image and js directories on an Apache web server?

I found this in the http.con file, but it is not doing what I thought it was supposed to do:

 <Directory "/var/www/html/myhome/js">
  Options -Indexes
  Order allow,deny
  Allow from all
</Directory>
share|improve this question

1 Answer 1

up vote 1 down vote accepted

-Indexes means it will prevent directory listing, so if someone just enter yoursite.com/js

will not see ALL files in that folder. If you set it properly in httpd.conf, it should work.

Also you can put a simple blank index.html in each folder. Then again your all js files will not be listed.

If you want search engines do not index files in those directories, you have to add that directory in robots.txt disallowed urls list.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.