lundi 2 juin 2014

apache htaccess redirect based on subnet mask


Vote count:

0




I need to redirect users coming from a certain subnets, ex: 99.99.0.0/20, 28.12.0.0/14, etc.. I've looked at several solutions, including the one below but, due to the diversity and number of ips, it's not doable.



RewriteEngine on
RewriteCond %{REMOTE_ADDR} ^99\.99\.0\.[0-9]$
RewriteCond %{REQUEST_URI} !^/index/
RewriteRule .? /index/ [R,L]


What do I need to add to the apache .htaccess file in order to achieve this ?



asked 40 secs ago






Aucun commentaire:

Enregistrer un commentaire