简体   繁体   中英

.htaccess block local ip address

I have 3 applications running on wampserver hosted on our intranet.

I would like to block the access of applications for a certain ip range. So I edited .htaccess files for each application as below. But the application is not blocked.

order deny,allow allow from 10.212.4. deny from all

After checking the logs I found that the ip address the client returning was different. Since all our machines use proxy settings by default.

Anyone could help me how to over come this ?

You can use mod_rewrite to block people based on their "x-forwarded-for" header. I would not consider this secure though, because these are easy to forge.

See the discussion here:

http://www.110mb.com/forum/empty-t26129.0.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM