Blocking visits using GeoIP
MaxMind DB1 is an Apache module of GeoIP that aims to locate a user based on their IP address.
Installation
Run the following commands in SSH at the root of the account:
Note
Then add in the Web > Configuration menu of your alwaysdata administration interface:
Finally create an account on their interface to retrieveone of their databases: free or paid depending on your needs.
Uses
Block some countries
In this example, we are using the free database which we place at the root of the account and we block China and the United States.
Add the following at the top of a .htaccess file at the root of the website:
Only allow certain countries
In this example, we are using the free database which we place at the root of the account and we only allow France.
Add the following at the top of a .htaccess file at the root of the website:
MaxMind DB can also be used for geotargeting in marketing and offers city-level databases. ↩︎