homepage Welcome to WebmasterWorld Guest from 23.20.63.27
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
.htaccess Allow POST method for ONLY cetain IP ranges
BlackRaven




msg:4433739
 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)

Thanks.

<Limit POST>
order deny,allow
# Country: CANADA
# ISO Code: CA
# Total Networks: 6,365
# Total Subnets: 79,978,496
allow from 23.16.0.0/16
allow from 23.17.0.0/16
allow from 24.36.0.0/16
allow from 24.37.0.0/16
...
allow from 192.197.216.0/24
allow from 216.254.192.0/19
#
deny from all
</Limit>

 

phranque




msg:4433899
 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved