setting up imgred with rewrite
Quote from creativebits.org:
Don't hotlink, ImgRed instead
Hotlinking is when you use the image from one website on another website without copying the image to the second website's server.
Most website operators hate when people do that to their images if they don't link back to the source. (...) You can of course avoid all this problem by saving the image and uploading it to your own server. (...) [Alternatively] You can use the service called ImgRed. All you do is add http://imgred.com/ in front of the url of the image you want to display and ImgRed will take the image (once) and create a copy of it on ImgRed's servers.
I guess this was not the complete idea of the creator of imgred.com. It was rather to provide others with an easy-to-use showcase solution which everyone can adopt for their own server.
Unfortunately, the code is not ready for any server: if you don't have permission to run the PHP exec command on your host, which is very likely if you don't have a pro account, the script will fail. A very simple solution to this problem is to replace the user defined function GetMIMEType by the PHP function mime_content_type.
For my purpose, I set up a rewrite rule which allows me to add /imgred/ in front of the original URL of the image. Nevertheless it was tricky to find out that per default, any double slash // in a webhost path is reduced to a single slash. So I had to find the following workaround:
RewriteRule ^imgred/http:/(.*) /imgred.php?Image=http://$1
RewriteRule ^thumbred/http:/(.*) /imgred.php?Thumb=http://$1
The source code for the above image looks as follows:
<img alt="any example image" src="/thumbred/http://adsoftheworld.com/files/images/CalciWWF.preview.jpg" width="100%"/>



