View Full Version : Redirect specific IP to different page
dartho
11-24-2005, 05:11 AM
There is a user/site (they always the same IP address) that I want to return a Error 404 type page or a redirect to a different site or just a blank page - basically I don;t what them to see my site at all.
I imagine I would have to edit the GLobal.php file, but am not quite sure how or what to add in ..
Any help appreciated!
Thanks
calorie
11-24-2005, 07:56 AM
vB 3.5.x: ACP -> Plugin System -> Plugin Manager -> Add New Plugin
Product: vBulletin
Hook Location: init_startup
Title: 404 IP Address
Plugin PHP Code: code is below
Plugin is Active: Yes
// Start 404 IP Address
/************************************************** ***************
REMEMBER TO CHANGE xxx.xxx.xxx.xxx TO THE IP TO BLOCK
************************************************** ***************/
if (IPADDRESS == 'xxx.xxx.xxx.xxx' OR ALT_IP == 'xxx.xxx.xxx.xxx')
{
if (SAPI_NAME == 'cgi' OR SAPI_NAME == 'cgi-fcgi')
{
header("Status: 404 Not Found");
}
else
{
header("HTTP/1.1 404 Not Found");
}
die('HTTP/1.1 404 Not Found');
}
// End 404 IP Address
vB 3.0.x: at the end of includes/init.php right before ?> add:
/************************************************** ***************
REMEMBER TO CHANGE xxx.xxx.xxx.xxx TO THE IP TO BLOCK
************************************************** ***************/
if (IPADDRESS == 'xxx.xxx.xxx.xxx' OR ALT_IP == 'xxx.xxx.xxx.xxx')
{
if (SAPI_NAME == 'cgi' OR SAPI_NAME == 'cgi-fcgi')
{
header("Status: 404 Not Found");
}
else
{
header("HTTP/1.1 404 Not Found");
}
die('HTTP/1.1 404 Not Found');
}
Watson
11-24-2005, 09:16 AM
There is a user/site (they always the same IP address) that I want to return a Error 404 type page or a redirect to a different site or just a blank page - basically I don;t what them to see my site at all.
I imagine I would have to edit the GLobal.php file, but am not quite sure how or what to add in ..
Any help appreciated!
Thanks
The Miserable Users hack is ace for doing this
dartho
11-24-2005, 09:24 AM
Thanks Calorie - works a treat!!
@Watson - I saw that one, and will install it (looks great!) - but this is aimed at an unwanted "Guest", I got the impression that the miserable users hack was only for registered users who actually log on.
Thanks!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.