문제

I'm trying to allow visitors access to a domain by following a few rules apply but do not know all the rules together, when I paste the codes separated, they work, but when lap together, is always worth the last, so I'm doing the same or something wrong?

I plan to put three kinds of locks, the first lock is the lock via IP, IP will allow only a certain country, I already have this code (CIDR), the second block is blocking proxy, this code I do not know if 'm using right, every tutorial I see written in a way, I think I'm missing something here possibly since the third lock is blocking User-Agent (browser), want to allow only one type of User-Agent, and I have this code is working properly.

I do not understand why the htaccess file not generate Forbidden in the first block:

1 - IP 2 - Proxy 3 - User-Agent

If a visitor has an IP that is not in the list of permitted, he should be locked away, but if it is not using proxy, he can view the content that was supposed to be locked.

It is as if he had an OR logic but a logical AND (about this), I want it to be blocked if any of the locks is enabled, no need to be all together (AND).

Sorry for bad english, I do not know if I spoke clearly, but I have this problem.

도움이 되었습니까?

해결책

I was using "SetEnvIf" and "SetEnvIfNoCase" and it was not that way, I'm using RewriteCond and whole trick is for the code "RewriteRule ^ (. *) $ - [L, F]" that terminates execution if a condition is true

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top