vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Redirect specific IP to different page (https://vborg.vbsupport.ru/showthread.php?t=101443)

dartho 11-24-2005 05:11 AM

Redirect specific IP to different page
 
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

Code:

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

Code:

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

Quote:

Originally Posted by dartho
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!


All times are GMT. The time now is 03:19 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00905 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete