Protecting an
image on a web site is difficult. Watermarks are
probably the only sure way to secure an image, but even then
it's possible for another site to "hotlink" to your image and
in effect use your bandwidth to power their site.
Myspace users are often guilty of this, perhaps not as much
out of maliciousness as out of ignorance. Even so, the
cost to you can be real!
There is a way to prevent another
site from linking directly to and using your image and
traffic; use the .htaccess file and what's called a "Rewrite"
rule to block access. The code looks like
this: RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} #!^http://(www\.)?myspace.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]
These lines
go inthe ".htaccess" file, which needs to be in the "WWW"
folder in your site. The .htaccess file can be difficult
to edit since most FTP programs cannot "see" files beginning
with a period. We recommend using your account control
panel File Manager, and then creating a new file called
".htaccess" and editing it accordingly. Note that the
sample code here is directly at Myspace.com only - if a different site is the problem you'll have to change that.
The .htaccess page is also used for other
things; see Custom Error Pages for another use.
NOTE: htaccess cannot be used in conjunction with a
Frontpage-enabled web
site.
|