Forum Moderators: phranque
Welcome to WebmasterWorld!
Please post your current relevant code so we can discuss it.
It's quite easy to do using mod_rewrite; As a matter of fact, you must do it if you wish to use custom error pages. Otherwise, banned users can't fetch the 403-Forbidden error page, and this puts your server in a loop!
Jim
<Files .htaccess>
order allow,deny
deny from all
</Files>
##########################################################
order allow,deny
deny from 166.**.185.11
allow from all
##########################################################
ErrorDocument 403 /error/403.shtml
ErrorDocument 404 /error/404.shtml
ErrorDocument 500 /error/500.shtml
Thanks for your help.
[edited by: jdMorgan at 4:58 am (utc) on June 8, 2005]
[edit reason] Obscured IP address. [/edit]
SetEnvIf Request_URI "\.htaccess$" block
SetEnvIf Request_URI "\.htpasswd$" block
SetEnvIf User-Agent "larbin" block
SetEnvIf Request_URI "^/path_to_allowed_file$" allow
SetEnvIf Request_URI "^/robots\.txt$" allow
SetEnvIf Request_URI "^/403\.shtml$" allow
#
Order deny,allow
Deny from 166.**.185.11
Deny from block
Allow from allow
#
ErrorDocument 403 /error/403.shtml
ErrorDocument 404 /error/404.shtml
ErrorDocument 500 /error/500.shtml
Jim