Reputation: 8524
Our web application needs no php code and our apache has no php installed,
but there are annoying php requests from different unwanted sources all the time.
How can I configure apache to ignore them, that those requests don't spoil the apache error log.
As we have unrestricted access to the server, we do not need an htaccess file.
Thanks alot in advance
Upvotes: 2
Views: 1994
Reputation: 2900
Aside from the previous answer to forbid all php requests, you can also not log them with:
SetEnvIf Request_URI "\.php.*?" no_log
CustomLog /path/to/vh-access.log common env=!no_log
Upvotes: 2
Reputation: 7476
You can try this in your httpd.conf
in your section where mod_rewrite is mentioned
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule \.php.* - [F,L]
</IfModule>
Upvotes: 2