How do I restore original visitor IP with MyBB forums? CloudFlare

More recent versions of MyBB include a Scrutinize User’s IP address option.

Admin CP > Configuration > Server and Optimization Options > Scrutinize User’s IP address? > Yes

Alternatively, you may install the [Cloudflare Management plugin](http://mods.mybb.com/view/antoligy-mybb-cloudflare-management-plugin) available for MyBB 1.6 (which does the same thing).

MyBB 1.6.0, 1.6.1, 1.6.2, or 1.6.3

  1. Navigate to ./inc/functions.php
  2. Go to line 2790
  3. Replace:
    if(isset($_SERVER['REMOTE_ADDR']))

    With:

    if(isset($_SERVER['HTTP_CF_CONNECTING_IP']))

    Replace:

    $ip = $_SERVER['REMOTE_ADDR'];

    With:

    $ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
Like
Like Love Haha Wow Sad Angry