![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
|||||||
| FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Computer Security Covers issues surrounding security such as firewalls, intrusion detection systems, badware, browser security and more. |
|
|
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Deny everyone access, then allow certain hosts/IP addresses
ErrorDocument 403 /GoAway.html <Limit GET POST> order deny,allow deny from all # Allow all IP's starting with 21.22.23. allow from 21.22.23. # Allow access from Google.com allow from .google.com </Limit> For referrers, use this: Block traffic from competitors site / case insensitive RewriteEngine on # Options +FollowSymlinks RewriteCond %{HTTP_REFERER} competitorsite\.com [NC,OR] RewriteRule .* - [F] Uncomment the line with "Options +FollowSymlinks" above (remove the #) if your server is not configured with FollowSymLinks in its <directory> section of the httpd.conf, and you get a 500 Internal Server error when using the code above as is. Let me know if that works for you! Best regards, Jim. |
|
|||
|
Quote:
What is the code to block several sites? Thanks! |
|
||||
|
You can always block an entire range, say 21.22.23.x by using:
order allow,deny deny from 21.22.23 allow from all You can block ranges using CIDR (Classless Inter-Domain Routing [sounds like 'cider']), so that the command deny from 21.22.0.0/16 would block everything in the 21.22.x.x range. BTY - the command: deny from 21.22 does the same thing as the command above it. Hope that helps. Regards, Jim. |
|
|||
|
this can also be done by using a php script. However the disadvantage of my suggested method is that it will only apply to whatever pages you include the code on. But this can be an advantage, depends on whatever point of view you have. For me it is an advantage and here is the php code you need to use to block an ip using a php script.
PHP Code:
__________________
- |
![]() |
| Thread Tools | |
| Display Modes | |
|
|