This block will only prevent POST requests from hosts other than 127.0.0.1, and you will receive a 403 Forbidden response. You can try using mod_rewrite and replace <LIMIT>
with:
RewriteCond %{REQUEST_METHOD} POST # allow the server to POST to itself RewriteCond %{REMOTE_ADDR} !127.0.0.1 # allow POST from trusted users RewriteCond %{REMOTE_ADDR} !123.456.789.123 # send all other post requests to 403 forbidden RewriteRule ^ / [F]
If you prefer to send a mail request to the home page of your site, instead of [F]
, the last line should be [R,L]
You would replace /
with where your "homepage" is, if it's not just /
.
source share