views:

31

answers:

0

Recently, my website was hammered with thousands of POST requests from various bots.

Instead of taking the approach of blocking these bots based on their user agent, I've decided to find a way to block all POST requests sent to my website and allow all POST requests from within my website.

I came up with the following:

RewriteEngine on
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{HTTP_HOST} !.*mydomain.com.*
RewriteRule ^.* - [F,L]

but for some reason it doesn't work. Any ideas?

Thanks!