htaccess “order” Deny, Allow, Deny

前端 未结 6 814
天命终不由人
天命终不由人 2020-12-04 06:44

I would like to allow only one country access, but exclude proxies within this country.

This is what I have (shortened version for convenience)



        
6条回答
  •  遥遥无期
    2020-12-04 06:52

    Not answering OPs question directly, but for the people finding this question in search of clarity on what's the difference between allow,deny and deny,allow:

    Read the comma as a "but".

    • allow but deny: whitelist with exceptions.
      everything is denied, except items on the allow list, except items on the deny list
    • deny but allow: blacklist with exceptions.
      everything is allowed, except items on the deny list, except items on the allow list

    allow only one country access, but exclude proxies within this country

    OP needed a whitelist with exceptions, therefore allow,deny instead of deny,allow

提交回复
热议问题