|
No sense being a liar, my .htaccess file leaves a lot to be desired. But hey, we all start some where.
What I'm hoping is someone can help me correct my mistakes and in particular, help me with my problems setting up blocking traffic from certain sites. (refer sites)
All help and any help is greatly appreciated and I promise to ask stupid questions just until I start asking smart ones.
Here is my file.
Order Deny,Allow
Deny from xxx.xxx.xxx.xxx
Deny from xxx.xxx.xxx.xxx
deny from xxx.xxx.xxx.xxx
<FilesMatch "^410[^.]*\.shtml$">
Allow from all
</FilesMatch>
Options All -Indexes
RewriteEngine on
RewriteCond %{HTTP:VIA} !^$ [NC,OR]
RewriteCond %{HTTP:FORWARDED} !^$ [NC,OR]
RewriteCond %{HTTP:USERAGENT_VIA} !^$ [NC,OR]
RewriteCond %{HTTP:X_FORWARDED_FOR} !^$ [NC,OR]
RewriteCond %{HTTP:PROXY_CONNECTION} !^$ [NC,OR]
RewriteCond %{HTTP:XPROXY_CONNECTION} !^$ [NC,OR]
RewriteCond %{HTTP:HTTP_PC_REMOTE_ADDR} !^$ [NC,OR]
RewriteCond %{HTTP:HTTP_CLIENT_IP} !^$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^ia_archiver [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Alexa\ Toolbar [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^GoogleToolbar\ Toolbar [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Google\ Toolbar [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^MSN\ Toolbar [NC,OR]
RewriteCond %{http_user_agent} ^alexa\ toolbar [NC,OR]
RewriteCond %{HTTP_REFERER} txxxxx\.com [NC,OR]
RewriteCond %{HTTP_REFERER} sxxxxx\.com [NC,OR]
RewriteCond %{HTTP_REFERER} axxxxx\.org [NC]
RewriteRule !403\.shtml$ - [F]
# Block image hotlinking
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^site \. xxx [NC]
RewriteRule \.(gif¦jpe?g)$ - [NC,F]
ErrorDocument 403 /403.shtml
|