Block Australian visitors from your website until their laws improve.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

block-au.apache.conf 938B

1234567891011121314151617181920212223
  1. # Installing:
  2. # 1. Place in /etc/apache2/conf-available/block-au.conf
  3. # 2. Place block-au.php in your webroot
  4. # 3. Replace domain.com below with your domain
  5. # 4. Download the GeoLite2 Country database from https://dev.maxmind.com/geoip/geoip2/geolite2/ and place it in /usr/local/share/GeoIP
  6. # 5. Install the MaxMindDB Apache module from https://maxmind.github.io/mod_maxminddb/
  7. # 6. Run `a2enconf block-au`
  8. # 7. Restart Apache
  9. # 8. Australian visitors will now be redirected to the block message.
  10. MaxMindDBEnable On
  11. MaxMindDBFile DB /usr/local/share/GeoIP/GeoLite2-Country.mmdb
  12. MaxMindDBEnv MM_COUNTRY_CODE DB/country/iso_code
  13. SetEnvIf MM_COUNTRY_CODE ^(AU) BlockCountry
  14. <Location "/">
  15. <If "env('BlockCountry') == '1'">
  16. RewriteEngine On
  17. RewriteCond %{REQUEST_URI} !/block\-au\.php$ [NC]
  18. RewriteRule "^(.*)$" "https://domain.com/block-au.php" [L,R=302]
  19. </If>
  20. </Location>