I am trying to block a bot using .htaccess in my WordPress site.
The host name is: ec2-D1-D2-D3-D4.us-east-2.compute.amazonaws.com
Where D1, D2, D3, D4 are sequnce of 1-3 digits, ie. [0-9]+ will match.
In some cases only D1,D2 & D3 exists.
I am trying:
RewriteCond %{HTTP_REFERER} ^ec2-[0-9]+-[0-9]+-[0-9]+\.us\-east\-2\.compute\.amazonaws\.com$ [OR]
RewriteCond %{HTTP_REFERER} ^ec2\-[0-9]+\-[0-9]+\-[0-9]+\-[0-9]+\.us\-east\-2\.compute\.amazonaws\.com$
RewriteRule ^.*$ - [F,L]
It does not seem to work. What am I missing?