510 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+4 more
pxt says

Some copyright violators which steal from the marketplaces hot link your preview images straight from your servers if you have any. This is a waste of server bandwidth and it also helps them steal.

So I put together this bit of Rewrite magic. Now when a violator embeds images straight from my server, their visitors see a nice big warning image like this:

Just use the statements below in a .htaccess file and you’re off.

# Stop only these sites...
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?bad-site\.org/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?another-bad-site\.com/ [NC]
RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://domain.com/path/to/warning/image.png [L]

# Or allow only my sites...
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mywebsite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://domain.com/path/to/warning/image.png

Of course this only works with those sites which hot link straight from author’s servers. But I found that a large proportion actually do this so it is worth the while.

Also posted on Forrst Link Like it there if you’re a member.

68 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
spotnil says

AWESOME . (period)

Many Thanks!

240 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
+2 more
phpdude says

Not bad, but if you only allow your site, what about all those legit sites that use the Envato API and autopost to WordPress and add their referral username?

Stopping only bad sites is decent enough, but this won’t stop those kind of people, so example stuff like annoym.to.

I like your thinking, but nothing is foolproof and trying to trick warez sites is impossible.

Just a thought.

3788 posts Community Moderator
  • Helps us moderate the forums
  • Contributed a tutorial on Tuts+
  • Located in Netherlands
  • Made it to the Authors' Hall of Fame
+9 more
Joost Moderator says

and trying to trick warez sites is impossible.

Not at all! In fact, these things greatly annoy these guys and as soon as it’s too much of a hassle, they’ll quit.

The thing is, though.. most of our previews are hosted with Envato, and Envato could never add this to the htaccess – it would simply destroy quite a lot of advertising that’s based around these images :o But yeah, it’s a great suggestion for privately hosted images!

510 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+4 more
pxt says

Not bad, but if you only allow your site, what about all those legit sites that use the Envato API and autopost to WordPress and add their referral username?

Stopping only bad sites is decent enough, but this won’t stop those kind of people, so example stuff like annoym.to.

I like your thinking, but nothing is foolproof and trying to trick warez sites is impossible.

Just a thought.

I agree that it’s not foolproof. But I found that a decent proportion do just hot link. Also, I use the version which allows everyone except those I specify so that all the legitimate sites which promote with the Envato API can continue to do so. I have nothing against those sites as they bring traffic in. :)

1612 posts
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Contributed a free file of the month
+9 more
DaniMun says

You deserve a superstar badge! Thanks for sharing! :)

And yes, definitely agreed, the less restrictive way is better.

240 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
+2 more
phpdude says


and trying to trick warez sites is impossible.
Not at all! In fact, these things greatly annoy these guys and as soon as it’s too much of a hassle, they’ll quit.

I respectfully disagree. These are the same people who nullify much larger commercial scripts. so they have the know-how to get around it.

Agreed, this is a deterrent and will put people off, but there’s always a way around it.

1612 posts
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Contributed a free file of the month
+9 more
DaniMun says

^ Yet, genuine buyers will always be genuine buyers. Respect! :)

1799 posts
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+4 more
BroOf says

Great! This will shock them for a short time but they will find other ways…

510 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+4 more
pxt says

Mr Moderator, thanks for the superstar badge :)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by