Block requests with invalid characters – .htaccess

Add the below given code in your .htaccess file

RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} !^[A-Z]{3,9} [a-zA-Z0-9.+_/-?=&]+ HTTP/ [NC]
RewriteRule .* – [F,NS,L]

Share

Leave a Reply

Your email address will not be published. Required fields are marked *