MyBB Community Forums

Full Version: IP2Location IP-Country Blocker Path Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Sorry, I'm kind of new to this and this probably a dumb question, but I noticed this plugin not working on my forum (the countries I blocked are still able to access and register). I think maybe because I configured path wrong. 

This is how I have it, is that wrong? 

var/www/forum/files/IP2LOCATION-LITE-DB1.BIN


Thank you in advance!
Anyone? Thank you
(2018-07-18, 01:59 PM)YellenLy Wrote: [ -> ]Sorry, I'm kind of new to this and this probably a dumb question, but I noticed this plugin not working on my forum (the countries I blocked are still able to access and register). I think maybe because I configured path wrong. 

This is how I have it, is that wrong? 

var/www/forum/files/IP2LOCATION-LITE-DB1.BIN


Thank you in advance!

You can add this to your .htaccess file as shown at the bottom part of this code screen. 
The IP list is quite long, but you get the idea.

SubstituteMaxLineLength 20M
LimitRequestBody 99999999999
SetEnv PHPRC /xxxxxxxx/xxxxxxxx/public_html/php.ini → (root folders X'd out for security reasons. Your root folder name would go there)
#Always redirect to https://luxorforums.com/
RewriteEngine on

# Some hosts require RewriteBase to make RewriteRules work.
RewriteBase /

# Google SEO workaround for search.php highlights:
# Make this rule the first rewrite rule in your .htaccess!
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^([^&]*)&(.*)$ https://luxorforums.com/$1?$2 [L,QSA,R=301]

# Google SEO 404:
ErrorDocument 404 /misc.php?google_seo_error=404

# Google SEO Sitemap:
RewriteRule ^sitemap\-([^./]+)\.xml$ misc.php?google_seo_sitemap=$1 [L,QSA,NC]

-- SNIP --

# Google SEO URL Events:
RewriteRule ^Event\-([^./]+)$ calendar.php?action=event&google_seo_event=$1 [L,QSA,NC]

Options -MultiViews +FollowSymlinks -Indexes

#
# If mod_security is enabled, attempt to disable it.
# - Note, this will work on the majority of hosts but on
#   MediaTemple, it is known to cause random Internal Server
#   errors. For MediaTemple, please remove the block below
#

#this list includes network data on the following countries:
#GHANA
<Limit GET POST>
order allow,deny
deny from 41.57.116.0/22
deny from 41.57.192.0/18
deny from 41.66.192.0/18
deny from 41.74.80.0/20
deny from 41.75.48.0/20
deny from 41.76.24.0/21
deny from 41.77.64.0/21
deny from 41.78.40.0/22
deny from 41.78.124.0/22
deny from 41.78.144.0/22
deny from 41.79.96.0/22
deny from 41.93.128.0/17
deny from 41.139.0.0/18
deny from 41.189.160.0/19

Or you can use Cloudflare's Firewall/Access Rules section and add countries in there to block any user from those countries from entering your website.