View Single Post
Old 11-24-2025, 11:30 AM  
cerulean
Web & App Development
 
cerulean's Avatar
 
Industry Role:
Join Date: Oct 2023
Location: United States
Posts: 217
You can do this with the MaxMind Apache module, and either Vacares or MojoHost can set this up for you no problem.

In the VirtualHost they'll setup mod_maxminddb, and set the MaxMindDBEnv for GEOIP_REGION_CODE and GEOIP_COUNTRY_CODE.

The code in the htaccess looks similar to this:

Code:
RewriteCond %{ENV:GEOIP_REGION_CODE} ^(TWO_LETTER_COUNTRY_CODES|CN|ETC)$
RewriteCond %{ENV:GEOIP_REGION_CODE} ^(TWO_LETTER_STATE_CODES|TX|ETC)$
RewriteRule ^(.*)$ blocked/index.php [L]
You will also want to expose certain things to these states/countries, depending on their use, such as whether they are a bot trying to crawl pages:

Code:
RewriteCond %{HTTP_USER_AGENT} !^.*(BOTS|GO|HERE).*$
You might also want to expose logos or scripts or other non-explicit content for your blocked page.

LoginBlue offers directory protection with MaxMind database integration (working on API integration), if you're looking to just protect your members area. It also supports AVS integration.
__________________
Cerulean Software Specializes in Website and App Development. Email me today!
Get a Custom Landing Page with TapClick.Link - For Small Businesses and Creators
Keep Your Business and Members Area Secure with LoginBlue Password and Content Protection
cerulean is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote