I am building an admin panel. and I want to block certain IP ranges. I’m testing this on my localhost wamp server but ir doesn’t seem to redirect me. Any input is appreciated. Answer Is sufficient to use string comparison Update: Taken from the comments of inits answer Suppose i want to block any IP coming from this range: 192.168.0.1-255.