Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Make Apache Drop Invalid Page Requests |
|
Author |
|
xyst
Joined: 22 Sep 2008 Posts: 2
|
Posted: Mon 22 Sep '08 1:16 Post subject: Make Apache Drop Invalid Page Requests |
|
|
I am trying to figure out how to stop apache from returning 404 errors. I want apache to just ignore the request and not return anything (the client will just timeout eventually). I am pretty sure I have configured apache2 in this way before, but I can't for the life of me figure out how to do it now. Am I crazy? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
|
Back to top |
|
xyst
Joined: 22 Sep 2008 Posts: 2
|
Posted: Mon 22 Sep '08 16:12 Post subject: |
|
|
Maybe I wasn't clear. I don't want an error handler because I don't want apache to return anything. I want apache to just drop the request and let the client timeout. I already read through the whole error handler page before, and it appears to me that you cannot use the ErrorDocument directive not return anything. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Mon 22 Sep '08 22:01 Post subject: |
|
|
I understood you .. I'm sure James did but I am not sure he understands how Apache 1.3.x dealt with things. I may be wrong, if so sorry James.
One thing I have noticed in 2.2.x that is different from 1.3 is the ability to do just that, "Just not answer." It seems determined to answer in one fasion or another. In my experience,
say in 1.3 I
deny from your-ip
With 1.3, if you came to my site, nothing would happen and your browser would time-out. In 2.2 however, it is determined to answer, with 403 obviously.
I think you could use RewriteRule and RewriteCond to do this, just have it set for maybe something like this
Code: | RewriteEngine On
RewriteCond %{REDIRECT_STATUS} 404
RewriteRule ^/(.*) http://1.1.1.1/$1 [L,R] |
Have not tried this .. but it should work I think.
I basically do this with download managers and spiders I do not like .. as well as IPs and such I want to stay off my Apache. One problem however is it does not want to work server-wide, so I made one file that has all this junk in it and then Include the file in every single vhost .. a pain .. but it works well for me.
EDIT:
Actually, please let me know if it does. I want to use something similar with unused error/status codes like 418,419,420 and set my mod security rules to these codes and they, the scoundrels, will simply get redirected to nothing.
I also see you mentioned 2.0.x, I skipped over that branch pretty much. |
|
Back to top |
|
|
|
|
|
|