AFAICT in Apache 2.2, you need to return to the Satisfy Any approach, and then process the method check with mod_rewrite. This is the best route because your method checks are completely independent.
In 2.4, Limit / LimitExcept is replaced / simplified by mod_allowmethods, but require can also directly test methods. Itβs much easier.
The rewrite part is pretty simple:
RewriteEngine ON RewriteCond %{REQUEST_METHOD} !^(GET|HEAD|POST)$ RewriteRule .* - [F]
But you need to make sure that it appears on every main vhost + server that can access the directory, unlike other directives.
Introducing everything together
# Only allow expected HTTP methods. RewriteCond %{REQUEST_METHOD} !^(GET|HEAD|POST)$ RewriteRule .* - [F] <Directory /path/to/wwwroot> Options FollowSymLinks AllowOverride FileInfo Satisfy any
source share