Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My index files are the standard index.html. While GET /dir/ returns /dir/index.html, I would like to return a 404 status code to the request GET /dir/index.html. Is there a simple way to do this under Apache?

share|improve this question

Use mod_rewrite:

    RewriteEngine On
    RewriteRule ^/dir/(index.html)?$ /404 [L]
share|improve this answer

Your Answer


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.