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

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

1 Answer 1

Use mod_rewrite:

    RewriteEngine On
    RewriteRule ^/dir/(index.html)?$ /404 [L]
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.