0

I have an Apache 2 running on a Linux box. Currently there at only 2 webpages in different paths:

/website1/site
/website2/site

I set apache to not server directory listings and I set the error documents to show a blank page when hitting something that doesn't exit.
I was wondering, is there any way force Apache to always return 404 or other error every time something other than those two websites are hit?

We are experiencing a lot of probes from proxy list sites and other places and all I want to do is just send an error every time they try / or any other path, without serving anything, not error pages, blank pages, etc.

helps is appreciated.

1
  • "I was wondering, is there any way force Apache to always return 404 or other error every time something other than those two websites are hit?" If it's not giving an error already, then it's serving content that doesn't exist? I'm confused. What happens when they try to access a website that apache isn't serving?
    – Kyle Buser
    Oct 18, 2010 at 17:44

1 Answer 1

0

You could add a few mod_rewrite directives to throw them for a loop:

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{HTTP_HOST} ^1\.2\.3\.4$
    RewriteRule .* http://%{REMOTE_ADDR} [R=301]
</IfModule>

(where 1\.2\.3\.4 is a regexp matching your server's IP address(es) ...)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .