Linode Forum
https://forum.linode.com/

Incoming redirects by network range
https://forum.linode.com/viewtopic.php?f=19&t=4587
Page 1 of 1

Author:  marcus0263 [ Wed Sep 02, 2009 5:03 pm ]
Post subject:  Incoming redirects by network range

I wanna redirect incoming networks, not just specific IP's with Apache, would this be correct?

Code:
RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^192\.168\.0\.0$
RewriteRule .* http://www.google.com

Author:  fukawi2 [ Wed Sep 02, 2009 7:28 pm ]
Post subject:  Re: Incoming redirects by network range

I think it would need to be more along the lines of the following since it's a regex comparison, and Apache isn't aware of the CIDR / network address in this module.

Code:
RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^192\.168\.0\.[0-9]{1,3}$
RewriteRule .* http://www.google.com

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/