510 posts
  • Beta Tester
  • Bought between 10 and 49 items
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 4-5 years
  • Microlancer Beta Tester
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 1 000 and 5 000 dollars
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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
spotnil says

AWESOME . (period)

Many Thanks!

230 posts
  • Has been a member for 4-5 years
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Bought between 1 and 9 items
  • Referred between 1 and 9 users
  • United Kingdom
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.

3649 posts Community Moderator
  • Has been a member for 5-6 years
  • Contributed a Tutorial to a Tuts+ Site
  • Netherlands
  • Community Moderator
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Exclusive Author
+4 more
Joost Volunteer 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
  • Beta Tester
  • Bought between 10 and 49 items
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 4-5 years
  • Microlancer Beta Tester
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 1 000 and 5 000 dollars
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
  • Author had a Free File of the Month
  • Microlancer Beta Tester
  • Beta Tester
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Referred between 1 and 9 users
+5 more
DaniMun says

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

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

230 posts
  • Has been a member for 4-5 years
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Bought between 1 and 9 items
  • Referred between 1 and 9 users
  • United Kingdom
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
  • Author had a Free File of the Month
  • Microlancer Beta Tester
  • Beta Tester
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Referred between 1 and 9 users
+5 more
DaniMun says

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

1799 posts
  • Has been a member for 5-6 years
  • Germany
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 5 000 and 10 000 dollars
  • Microlancer Beta Tester
  • Bought between 10 and 49 items
  • Referred between 1 and 9 users
BroOf says

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

510 posts
  • Beta Tester
  • Bought between 10 and 49 items
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 4-5 years
  • Microlancer Beta Tester
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 1 000 and 5 000 dollars
pxt says

Mr Moderator, thanks for the superstar badge :)

by
by
by
by
by
by