homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Hotlink Protection Watermark using PHP

Msg#: 4541181 posted 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!



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

Msg#: 4541181 posted 6:30 am on Feb 2, 2013 (gmt 0)

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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved