Forum Moderators: phranque
RewriteCond %{REMOTE_HOST} ^xx\.xxx\.xxx\.x$ [OR]
RewriteCond %{REMOTE_HOST} ^xx\.xx\.xx\.xxx$
RewriteRule .* - [F,L] RewriteCond %{REQUEST_URI} ^/images/logo\.jpg$ [L] RewriteRule ^/images/logo\.jpg$ [L] RewriteRule ^/
RewriteCond blahblah
RewriteRule (^|/|\.html)$ - [F] Deny from aa.bb
Deny from aa.bb.cc.0/19
Deny from aa.bb.0.0/14 after going somewhere on the website they shouldn't
SetEnvIf Remote_Addr ^xx\.xxx\.xxx\.xx$ getout
SetEnvIf Request_URI "^(/error/error403\.php|/styles/main.css|/robots\.txt)$" allowsome
order deny,allow
deny from env=getout
allow from env=allowsome RewriteCond %{REMOTE_HOST} ^xx\.xxx\.xxx\.x$ [OR] #27-03-2015, 10:13
RewriteCond %{REMOTE_HOST} ^xx\.xx\.xxx\.xxx$
RewriteCond %{REQUEST_URI} !^(/error/error403\.html|/styles/main\.css|/images/background\.jpg|/images/error/403\.jpg|/images/logo\.jpg|favicon\.ico|/robots\.txt)$
RewriteRule .* - [F] my host is now using Litespeed instead of Apache, and the above no longer works. Consequently I have had to change this to the Rewrite approach
Could you see any problems in using the above code?
RewriteRule ^error/error403\.html$ - [L]
RewriteRule ^styles/main\.css$ - [L]
RewriteRule ^(favicon\.ico|robots\.txt)$ - [L]
RewriteRule ^images/(background|error/403|logo)\.jpg$ - [L] RewriteRule ^error/ - [L] but allows things like the stylesheet, the error page, logo, backgrounds etc.