Force Apache to return 404 on each request

apache-2.2httphttp-status-code-404

I want my apache to return 404 for all HTTP GET requests. Including HTTP GET /.

Tried to play a bit with mod_rewrite for this (404.gif obviously does not exits)

                    RewriteEngine on
                    RewriteRule .* 404.gif [L]

But it doesn't seem to be acting very nice, this for some reason returns 400 Bad Request.

Could someone please provide a configuration example for apache 2 that will cause it to always return the wonderful 404 ?

p.s. Forgot to mention, I will be using this configuration for both HTTP & HTTPS.

Thank you,
Maxim.

Best Answer

Point the apache root directory to a blank directory. Why do you need this behavior?