Block scanner IPs and non-existent PHP file requests

This commit is contained in:
Peter Foster
2026-03-02 11:15:06 +00:00
parent 89a791e187
commit 0408731358

View File

@@ -150,6 +150,14 @@ Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
# Block known scanner IPs
RewriteCond %{REMOTE_ADDR} ^(20\.63\.96\.50|4\.193\.248\.52)$
RewriteRule ^ - [F,L]
# Block requests for PHP files that don't exist (webshell scanners)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.php$ - [F,L]
# Skip already processed .php files
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^services/.*\.php$ - [L]