Preventing firewall bypass by .htaccess

If someone knows your hidden Hosting IP address, they can bypass our firewall and try to access it directly. It is not common or easy to do so, but for additional extra security, we recommend only allowing HTTP access from our firewall.

//If using Apache, you can add the following to the top of your .htaccess file:
<FilesMatch ".*">
    Order deny,allow
    Deny from all
    Allow from 192.88.134.2
    Allow from 192.88.135.2
    Allow from 185.93.228.2
    Allow from 185.93.229.2
    Allow from 185.93.230.2
    Allow from 192.88.134.0/23
    Allow from 185.93.228.0/22
    Allow from 192.124.249.0/24
    Allow from 199.223.236.179
    Allow from 146.148.117.213
    Allow from 23.251.134.134
    Allow from 178.33.238.180
    Allow from 142.4.217.0/24
    Allow from 167.114.0.0/24
    Allow from 192.99.17.0/24
    Allow from 5.196.79.0/24
    Allow from 130.211.0.0/16
    Allow from 104.155.0.0/16
</FilesMatch>
//If using Nginx, you can add the following to the configuration file of your virtual host:

location / {
    allow 192.88.134.2;
    allow 192.88.135.2;
    allow 185.93.228.2;
    allow 185.93.229.2;
    allow 185.93.230.2;
    allow 192.88.134.0/23;
    allow 185.93.228.0/22;
    allow 192.124.249.0/24;
    allow 199.223.236.179;
    allow 146.148.117.213;
    allow 23.251.134.134;
    allow 178.33.238.180;
    allow 142.4.217.0/24;
    allow 167.114.0.0/24;
    allow 192.99.17.0/24;
    allow 5.196.79.0/24;
    allow 130.211.0.0/16;
    allow 104.155.0.0/16;
    deny all;
    # Existing NGINX rules
}

Leave a Reply