Perlaccess : Tutorials
Editing your Htaccess File (8.7)
by Jacob A. Wheeler
http://www.bigresources.com

Editing Htaccess File

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

In the above example, anyone who links to an image (with a .gif extension) from "gif.com" or "www.gif.com", on there geocities site (or any other site other then gif.com), will get a broken image. The above code tells apache to deny any request of serving an image (with a .gif extension) to a site outside of the domain gif.com/www.gif.com.

NOTE: Be sure to change gif.com & www.gif.com to your domain name!

Where do I place this htaccess file?
Place this htaccess file inside the directory of your images. If you have many subdirectories, like images/backgrounds, images/lines, place the htaccess file inside your /images dir.

Are there more options?

<< Back