Perlaccess : Tutorials
More Hot Linking Options (8.8)
by Jacob A. Wheeler
http://www.bigresources.com

More Hot Linking Options

(.htaccess file - can create in notepad, or dos 'edit')
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://gif.com/.*$     [NC]
RewriteCond %{HTTP_REFERER} !^http://www.gif.com/.*$ [NC]
RewriteRule .*\.jpg$        -                        [G]

The above example is similiar to the one on the last page, except this one will block any image ending in ".jpg", instead of ".gif".



How would I block both gif, and jpg images from being linked?

(.htaccess file - can create in notepad, or dos 'edit')
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://gif.com/.*$     [NC]
RewriteCond %{HTTP_REFERER} !^http://www.gif.com/.*$ [NC]
RewriteRule .*\.gif$        -                        [G]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://gif.com/.*$     [NC]
RewriteCond %{HTTP_REFERER} !^http://www.gif.com/.*$ [NC]
RewriteRule .*\.jpg$        -                        [G]
It's as simple as that!
    Some important notes to remember:
  1. Download your htaccess file in "binary" mode
  2. Upload your htaccess file in "ascii" mode
  3. Double check your site to make sure your images still work!



Main Index

<< Back