Ämne: Banna IP?
Visa ett inlägg
Oläst 2003-03-14, 00:39 #3
Filips avatar
Filip Filip är inte uppkopplad
Mycket flitig postare
 
Reg.datum: Jan 2003
Inlägg: 935
Filip Filip är inte uppkopplad
Mycket flitig postare
Filips avatar
 
Reg.datum: Jan 2003
Inlägg: 935
Att använda .htaccess funkar bara om du kör en Apache webbserver.
Följande är hämtat direkt ur Apaches användarmanual:


Access control
Authentication by username and password is only part of the story. Frequently you want to let people in based on something other than who they are. Something such as where they are coming from. Restricting access based on something other than the identity of the user is generally referred to as Access Control.

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 205.252.46.165
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 dc.numbersusa.com
And, if you'd like to block access from an entire domain, you can specify just part of an address or domain name:

deny from 192.101.205
deny from cyberthugs.com moreidiots.com
deny from ke
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.
Filip är inte uppkopplad   Svara med citatSvara med citat