VPS business hosting starting at $29.95/24/7 premium technical support

Ways to block user via .htaccess

#Order deny,allow
#Deny from all
#Allow from 3.92.40.40
#Allow from 4.30.3.0/4
#Allow from 4.30.3.18
#Allow from 4.30.3.15
#Allow from 104.9.55.44

RewriteCond %{REMOTE_ADDR} !^(4\.30\.3\.[0-9]*)$
RewriteCond %{HTTP:X-Forwarded-For} !^(4\.30\.3\.[0-9]*)$
RewriteCond %{REMOTE_ADDR} !^(104\.9\.55\.44)$
RewriteCond %{HTTP:X-Forwarded-For} !^(104\.9\.55\.44)$
RewriteRule ^(.*) - [F]

Author: Harshvardhan Malpani

PHP Developer based in New Delhi, India. Working as a freelance web developer providing server deployment, website development and maintenance services.

Leave a Reply

Your email address will not be published.