Blocking access for certain countries

Support Wissensdatenbank

Du bist hier:
Print

You want to share a folder only for certain countries (DACH) and block all other countries?

  1. Create the file .htaccess in the desired folder
  2. Add the following content to the .htaccess file
    GeoIPEnable On
    
    # Put countries to allow here
    SetEnvIf GEOIP_COUNTRY_CODE CH AllowCountry
    SetEnvIf GEOIP_COUNTRY_CODE DE AllowCountry
    SetEnvIf GEOIP_COUNTRY_CODE AT AllowCountry
    SetEnvIf GEOIP_COUNTRY_CODE LI AllowCountry
    Deny from all
    Allow from env=AllowCountry

     

  3. With our MaxMind GEOIP tool you can add or remove further countries and adapt the file to your wishes.

 

Please note that we update the database of IP addresses every night.

War dieser Artikel hilfreich?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
Wie können wir diesen Artikel verbessern?
Please submit the reason for your vote so that we can improve the article.
Brauchst du Hilfe?
Related Post