I want to block access of my site from one particular IP address, how can i do that.?
using htaccess or ?
I want to block access of my site from one particular IP address, how can i do that.?
using htaccess or ?
If you are using PHP, put this in your configuration file. Replace strings and variables as necessary to change the IP address or level of hatred.
<?php
$ip = 255.255.255.255;
if($_SERVER['REMOTE_ADDR'] == $IP)
{
die("I Hate You");
}
?>
I prefer this one:
$ip = 255.255.255.255; if($_SERVER['REMOTE_ADDR'] == $IP) { $array = array("I", "Hate", "You", "Alot"); $message = $array[rand(0,3)]; die($message); }
If they refresh the page enough, they might find out what I'm saying.
Off the top of my head, in .htaccess, put the following
order allow,deny
allow from all
deny from 10.my.ip.address
Not 100% sure, so please let me know if it worked.