Forum Moderators: phranque
This is my complete .htaccess file. (Direct copy and paste)
--------------------------------------
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(.*\.)?quux-phoo\.com [NC]
RewriteRule \.(gif夸pg夸peg如ng妃pg妃peg安mv地vi妃ov地sf存wf)$ - [NC,F]
order allow,deny deny from 66.11.54.71 deny from 66.11.54. allow from all
RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} alexa\.com [NC,OR]
RewriteCond %{HTTP_REFERER} example\.co\.uk [NC,OR]
RewriteRule .* - [F]
[edited by: jdMorgan at 2:53 pm (utc) on Dec. 23, 2006]
[edit reason] examplified [/edit]
RewriteCond %{HTTP_REFERER} example\.co\.uk [NC] If you have access to Apache's error log: read it, as it may contain relevant information.
[edited by: jdMorgan at 2:54 pm (utc) on Dec. 23, 2006]
[edit reason] Examplified [/edit]
I'm realy fumbling with this file. (Like I said I'm not very smart person)
It still doesn't appear to block referals from the sites I want to block. And I'm not certain at all if it's blocking the IP addresses I want to block.
But am I at least on the right track?
--------
order allow,deny
deny from 66.11.54.71
deny from 66.11.54.
allow from all
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(.*\.)?mysite.com [NC]
RewriteRule \.(gif¦jpg¦jpeg¦png¦mpg¦mpeg¦wmv¦avi¦mov¦asf¦swf)$ - [NC,F]
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} alexa\.com [NC,OR]
RewriteCond %{HTTP_REFERER} example\.co\.uk [NC]
RewriteRule .* - [G]
If required, the Options directive should be placed before the RewriteEngine directive as shown, for clarity.
I made a few more tweaks for the sake of efficiency.
Order allow,deny
Deny from 66.11.48.0/20
Allow from all
#
# Options +FollowSymlinks
RewriteEngine on
#
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)*mysite\.com [NC]
RewriteRule \.(gif夸pe?g如ng妃pe?g安mv地vi妃ov地sf存wf)$ - [NC,F]
#
RewriteCond %{HTTP_REFERER} alexa\.com [NC,OR]
RewriteCond %{HTTP_REFERER} example\.co\.uk [NC]
RewriteRule .* - [G]
As a result, you will still see requests with these referrers in your logs/stats, but your server's response should be a 403-Forbidden, rather than a 200-OK or any other "success" response.
For background information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim
I've been reading the tutorial and I'm just too stupid to understand it. What I'll do is search around and pay someone to write it for me. All of this is just way over my head and I'm really not a very smart person.
But thanks for your help and efforts.
I appreciate it a lot.
Take the "# " off the beginning of the Options line, and see if that helps.
Also, do you know for certain that mod_rewrite works on this server?
Lack of patience is far more disabling than lack of technical knowledge or confidence. I encourage you to keep trying.
Jim