Community

How can I block a Specific IP Address from .htaccess?

ma
mandanda34 #1

Hi, The allow-block command for .htaccess does not work in Cyberpanel. That’s why I’m having trouble directing a rope.

What I want to do is exactly this: I just want to redirect visitors from a particular ip to a different domain.

The following code works with redirect, but it applies to everyone. I just want it to work for specific ip addresses. I’ve tried many ways, but I failed.

RewriteEngine on
RewriteRule (. *) Https://newdomain.com/ [R = 301, L]

Thanks in advance for the help.

Sign in to reply