Msg#: 4433737 posted 12:29 am on Mar 27, 2012 (gmt 0)
Hi,I want a certain range of ips (Canada Country Block IPS) to only be able to use the POST method in my login page (http://www.mysite .com/index.php?m=account_login) and my registration page (http://www.mysite .com/index.php?m=account_register) However i want all ips to have access to my main site http:// www.mysite.com/index.php and be able to use the POST method there such as our contact page (http://www.mysite .com/index.php?m=contactus)
<Limit POST> order deny,allow # Country: CANADA # ISO Code: CA # Total Networks: 6,365 # Total Subnets: 79,978,496 allow from 22.214.171.124/16 allow from 126.96.36.199/16 allow from 188.8.131.52/16 allow from 184.108.40.206/16 ... allow from 220.127.116.11/24 allow from 18.104.22.168/19 # deny from all </Limit>
Msg#: 4433737 posted 12:59 pm on Mar 27, 2012 (gmt 0)
you'll have to write a series of RewriteCond directives to test the conditions of the REMOTE_ADDR, REQUEST_METHOD and QUERY_STRING environment variables and when the right conditions are met your RewriteRule should use the - (dash) substitution with or without the F (403 Forbidden response) flag as appropriate.