Re: Apache blocking certain requests instead of php
| From: | Jim Lucas | Date: | Wed, 23 Jul 2008 21:06:04 +0000 |
| Subject: | Re: Apache blocking certain requests instead of php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-277211@lists.php.net to get a copy of this message | ||
Arno Kuhl wrote:
I'm getting a lot of bogus requsts in the form of "index.php?id=http://64.15.67.17/~babysona/logo.jpg?", sometimes more than a hundred a day per domain. The php script catches it, logs the request, sends an email report and replies with "access denied", but it takes processing which I'd rather not have php busy with. (The php script rejects anything where id=something_not_numeric.) Is there a way for apache to catch these requests before passing it to php? Is it more efficient for apache to handle this than php? ArnoYes, in Apache turn off userdir access In your httpd.conf file do this. UserDir disabled That way it will not process url that starts with a tildy ~... That should take care of it. Apache should then only report a 404 error to the error log for the given virtual host. -- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Twelfth Night, Act II, Scene V by William Shakespeare