嗨,我有以下工作:
SetEnvIf Referer "^http://sub\.site1\.com/yvvl/Portal/" local_referral
SetEnvIf Referer "^http://sub\.site2\.com/yvvl/Portal/" auth_referral
SetEnvIf Referer "^http://sub\.site3\.com/yvvl/Portal/" authC_referral
Order Deny,Allow
Deny from all
Allow from env=local_referral
Allow from env=auth_referral
Allow from env=authC_referral
我不知道该怎么做是通配符所以从这3个域名中的任何东西都会被接受我的preg并不是很好
由于
答案 0 :(得分:2)
只需删除.com
之后的所有内容:
SetEnvIf Referer "^http://sub\.site1\.com/" local_referral
SetEnvIf Referer "^http://sub\.site2\.com/" auth_referral
SetEnvIf Referer "^http://sub\.site3\.com/" authC_referral
由于引用结束时没有fence-post(由$
字符表示),它将匹配以 http://sub.site1.com/
等开头的任何内容。