- Beta Tester
- Bought between 10 and 49 items
- Contributed a Tutorial to a Tuts+ Site
- Exclusive Author
- Has been a member for 3-4 years
- Referred between 1 and 9 users
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 1 000 and 5 000 dollars
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.
AWESOME . (period)
Many Thanks!
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.
- Has been a member for 4-5 years
- Author was Featured
- 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
phpdude said
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
But yeah, it’s a great suggestion for privately hosted images!
- Beta Tester
- Bought between 10 and 49 items
- Contributed a Tutorial to a Tuts+ Site
- Exclusive Author
- Has been a member for 3-4 years
- Referred between 1 and 9 users
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 1 000 and 5 000 dollars
phpdude said
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. 
- 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
- Item was Featured
- Author was Featured
- Referred between 1 and 9 users
You deserve a superstar badge! Thanks for sharing! 
And yes, definitely agreed, the less restrictive way is better.
Joost said
phpdude saidNot at all! In fact, these things greatly annoy these guys and as soon as it’s too much of a hassle, they’ll quit.
and trying to trick warez sites is impossible.
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.
- 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
- Item was Featured
- Author was Featured
- Referred between 1 and 9 users
^ Yet, genuine buyers will always be genuine buyers. Respect! 
Great! This will shock them for a short time but they will find other ways…
- Beta Tester
- Bought between 10 and 49 items
- Contributed a Tutorial to a Tuts+ Site
- Exclusive Author
- Has been a member for 3-4 years
- Referred between 1 and 9 users
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 1 000 and 5 000 dollars
Mr Moderator, thanks for the superstar badge 
