O'Reilly logo

WordPress MU 2.8: Beginner's Guide by Lesley A. Harrison

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - .htaccess settings to stop bad guys

  1. Download your .htaccess file and make a copy of it called htaccess.txt—keep the original as a backup.
  2. Open up htaccess.txt.
  3. You should see a line that says RewriteEngine On near the top of the file. Read through the file to find where the lines beginning with RewriteCond or RewriteRule end.
  4. After those lines, add the following:
    RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(*.)?yourdomain.com/.*$ [NC] RewriteRule .*\.(jpe?g|jpg|gif|bmp|png)$ http://www. someimagehostingsite.domain/antihotlink.jpg
    
  5. Also add the following lines:
    RewriteCond %{REQUEST_METHOD} HEAD RewriteRule .* - [F]
    
  6. If you would like to block email harvesters, add the following:
    RewriteCond %{HTTP_USER_AGENT} ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required