Pyh.conf’25: a new PHP conference for the Russian-speaking community

Voting

: seven plus two?
(Example: nine)

The Note You're Voting On

joerg at fenin dot de
17 years ago
To limit HTTP Request Methods on the Apache server running PHP you should use mod_rewrite or mod_security instead of LimitExcept, to give you more control over the handling of such http errors. Can go in .htaccess file or httpd.conf

# mod_rewrite
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD|POST)$
RewriteRule .* - [F,L]
</IfModule>

# mod_security
<IfModule mod_security.c>
SecFilterSelective REQUEST_METHOD "!^(GET|HEAD|POST)$" "deny,log,status:403"
</IfModule>

You can use the php request method scanner at askapache to see exactly how your server deals with various request methods, and check that your server is configured properly..

http://www.askapache.com/online-tools/request-method-scanner/

<< Back to user notes page

To Top