Jump to content

access control - how to do multiple rules ?


JoeJoe

Recommended Posts

Hi guys,

After read all the Apache documents, I got no answer for this.
How to config 2 sets of login/password? one is allow from all IP and one is from internal network only.

the order, deny, allow, satisfy stuff only help if one wants
1) login from all IP/domain
or/and
2) request from certain IP/domain [b]WITHOUT[/b] login

that is different from what I want, anyone knows how to solve this?

thank you very much

JoeJoe
Link to comment
https://forums.phpfreaks.com/topic/18811-access-control-how-to-do-multiple-rules/
Share on other sites

  • 2 weeks later...
JoeJoe,

Check out setEnvIf at http://httpd.apache.org/docs/2.0/mod/mod_setenvif.html

mod_access does not directly support referrer-based and URI based access control, but it can be accomplished using mod_sentenvif and the supported "Allow from env=<server_variable" construct. Here's a simple example:

setenvif Referer www.ok_site.com OK_allow
...
Allow from env=OK_allow

-or-

setenvif Request_URI ip-regex-here OK_allow
...
Allow from env=OK_allow
See mod_setenvif

Good Luck

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.