Hello, my wordpress built website is being hit by malicious bots looking for vulnerabilities. They keep checking php files that never even existed on my site. Some of the directories they are trying to reach never existed as well. Because my site is wordpress built each time a non existing file is requested wordpress loads some files increasing cpu load. The requests are so frequent so that my CPU load increases dramatically, completely freezing my vps.
I want to know if it is possible to block a request that includes a php file which does not exist via htaccess eg http//:example.com/nonexistingfolder/nonexisting.php or http://example.com/nonexsting.php
I am not sure if this is the proper way of adding this rule and I appreciate some help here
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d [NC,OR]
RewriteCond %{REQUEST_FILENAME} \.(php)$
RewriteRule ^(.*)$ - [F,L]
Kind regards
[edited by: engine at 6:21 pm (utc) on Dec 2, 2015]
[edit reason] please use example.com [/edit]