I have this code to prevent people from Mexico from accessing my domain name, but I wonder if I can add another line where I redirect them to another URL (A landing page on an email marketing page).
IS that possible? I appreciate any and all help and details you can provide.
In summary. I want to prevent people from Mexico from accesing the main domain (maindomain.com), but if they are elsewhere, I want to redirect them to another URL (externaldomain.com).
Here’s the code on my .htaccess (I removed some of the country IP listing for extension)
# -------------------------------------------------------
# Free IP2Location Firewall List by Country
# Source: https://www.ip2location.com/free/visitor-blocker
# Last Generated: 04 Jun 2024 00:54:33 GMT
deny from 217.8.116.0/24
deny from 217.76.242.0/23
deny from 223.27.114.0/24
deny from 223.119.251.0/24
order allow,deny
allow from all
I just edited the htaccess file to block the country, I wonder if it’s possible to redirect them. I am hosting the domain in cPanel on a VPS. The reason we need to block the domain is because we run email campaigns in the US, and the offers are excluvise of the US, but the service we use (ActiveCampaign) does not offer geo-blocking, and we need the data analytics our mailing campaigns produce in the custom domain they provide. But we have a main domain that we want to use. Just not have it accesible from Mexico.