0

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.

Maxim Veksler
  • 2,725
  • 10
  • 28
  • 32

1 Answers1

1

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

lg.
  • 4,649
  • 3
  • 21
  • 20
  • EC2 Server farm upgrade, when I upgrade one of the HTTPS servers I don't want all requests to it get swollen by EC2 Great firewall - So I would rather move the elastic ip of the server to another server, which always returns 404. My procedure is to move the elastic ip, upgrade the server, return the elastic ip to the original node. – Maxim Veksler Jul 28 '10 at 15:07
  • I've pointed the document root to a non existing directory. Blank gives directory listing when requested with "/" – Maxim Veksler Jul 28 '10 at 15:10