In a fair
People would be happy and respectful.
Everyone would also own a cute fluffy bunny and give strangers a hug on the
This is not a fair world.
People like to steal your content
If that wasn’t bad enough, they don’t just copy your stuff, they link directly to it from your website.
The cheek!
This is called hotlinking and is very
People will add your image URL into their own web pages passing it off as their own.
As a double-whammy, this eats into your website’s bandwidth without giving you a whisper of SEO link juice.
Let’s get the gloves out and slap those
Add the following code to the .htaccess file in the root of your WordPress installation.
[gist id=8143026 file=code-snippet-1.txt]
What does it do?
First things first.
Be as creative as you can
Lines 2-3 detect whether or not the requesting (incoming) URL is your own domain mysite.com (in this example).
Your own site needs to be able to display
If the URL contains another domain name then line 4 checks to see if it contains a request to display an image of types jpg, jpeg, gif,
If it does then we want to swap that image request with our own specific image URL.
So the
Example: hotlinking-thief.jpg