Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Hotlink Protection Watermark using PHP



12:52 am on Feb 1, 2013 (gmt 0)

Hello guys,

I own some websites (on wordpress platform) and I was affected by the new Google Image Search. My traffic dropped by 50% and I want to take measures.

Google is using my bandwidth and I don't get any visitor so I want to redirect the people who click to "View original image" to the hosted page of the image. Also I want to watermark the images so the visitors from Google will see: "Click for full resolution" or something like that.

Here is an example: [goo.gl ]
Click on one image and you will see that the image appears with a watermark "Click for full resolution". Also, if you click on "View original image" you will be redirected to the hosted page and not to the .jpg/.png/etc

I need that the code to be for referrals from: google.com, yahoo.com, bing.com only.

How can I do these 2 things? I would prefer a step by step because I am a beginner to PHP.

Also if you can help me (and maybe others) with the code I will remain grateful and God bless you!


6:30 am on Feb 2, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

Now, wait. Do you want to do this via a php script or in htaccess? (I am going to go way out on a limb and guess that you do not have your own server or even VPS, so we're not talking config file here.)

A simple referer-based redirect is two or three lines in mod_rewrite. In php it will take more than two lines. But then again, you will have more flexibility.

Either way, nobody is going to write it out for you :( But if you are willing to learn how to fish, someone will come along now and then to help disentangle the fishing line.

Featured Threads

Hot Threads This Week

Hot Threads This Month