| 進階會員 | http://httpd.apache.org/docs/howto/auth.html#allowdeny Allow and Deny The Allow and Deny directives let you allow and deny access based on the host name, or host address, of the machine requesting a document. The directive goes hand-in-hand with these is the Order directive, which tells Apache in which order to apply the filters. The usage of these directives is: allow from address where address is an IP address (or a partial IP address) or a fully qualified domain name (or a partial domain name); you may provide multiple addresses or domain names, if desired. For example, if you have someone spamming your message board, and you want to keep them out, you could do the following: deny from 11.22.33.44 Visitors coming from that address will not be able to see the content behind this directive. If, instead, you have a machine name, rather than an IP address, you can use that. deny from hostname.example.com And, if you'd like to block access from an entire domain, or even from an entire tld (top level domain, such as .com or .gov) you can specify just part of an address or domain name: deny from 192.101.205 deny from exampleone.com exampletwo.com deny from tld Using Order will let you be sure that you are actually restricting things to the group that you want to let in, by combining a deny and an allow directive: Order Deny,Allow Deny from all Allow from hostname.example.com Listing just the allow directive would not do what you want, because it will let users from that host in, in addition to letting everyone in. What you want is to let in only users from that host. |
| 回覆 |
| XML | RSS 2.0 | RSS |
本論壇所有文章僅代表留言者個人意見,並不代表本站之立場,討論區以「即時留言」方式運作,故無法完全監察所有即時留言,若您發現文章可能有異議,請 email :[email protected] 處理。