dimanche 31 mai 2020

Redirect non-allowed IPs to a certain page

I downloaded a .htaccess file from www.ip2location.com containing white-listed IP addresses, it essentially blocks all non-white list IP addresses, but I also want to also redirect non-white listed IPs to a certain page like "COMING SOON". How can I do this?

Here is the .htaccess file

```# -------------------------------------------------------
   # Free IP2Location Firewall List by Country
    # Source: https://www.ip2location.com/free/visitor-blocker
     # Last Generated: 25 Aug 2019 23:38:41 GMT
     # [Important] Please update this list every month
   # -------------------------------------------------------
  <Limit GET HEAD POST>
 order deny,allow
 allow from 23.248.181.0/24
 allow from 23.248.183.0/24
  allow from 23.248.185.0/24
 allow from 31.13.155.234/32
 allow from 31.13.156.64/29
 allow from 31.13.158.236/30
  allow from 31.13.159.16/28
 allow from 34.99.130.0/23
  allow from 34.103.146.0/23
 allow from 41.57.120.0/22
 deny from all
</Limit>```

note: my white-listed IP/range is more than this, just for simplicity purpose it gave a sample of white list IPs




Aucun commentaire:

Enregistrer un commentaire