Can't display .jpg on my site with <img> tag

Hey guys,

Sorry if this is in the wrong section, but I know it’s definitely a server side thing on the image hoster’s part. Why can’t I display, using the <img> tag, any of the images on funnyjunk.com?

For example, I use the following code to try and display a funnyjunk image on my website:


<img src="http://static.fjcdn.com/pictures/Reposting+on+Facebook+the+title+is+misleading_17cfd4_2520778.jpg" />

This, however, does not work, and redirects me to funnyjunk.com.

How are they doing this?

Correction, it does not actually redirect, but rather it just shows a broken picture link.

But why?? how??

You are seemingly hotlinking to an image on another website.

If I owned that site and did not want you to use my bandwidth for your gratification, I would generate the jpg with a time sensitive url so that others cannot link to my images.

Edit:

… or somehow obfuscate the real url of the image …

If I did own that site, and permitted others to use my images I would say so, and I would likely ask them to copy the image to their own site and not use my bandwidth.

If I was Yahoo, and owned Flickr and did not mind other people linking to my site (in fact I wanted it), and bandwidth was not an issue for me I would leave the urls of the images static.

Helps?

Why? Because bandwidth is expensive. They could be using mod_rewrite to prevent image hotlinking, such as

#RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(static\\.)?fjcdn/.*$ [NC]
RewriteRule \\.(gif|jpg|png)$ - [F]

Consider yourself lucky they didn’t replace the image you wanted with goatse or other extremely offensive pornography.

Thanks guys. Makes sense now.

Ah, I remember doing this about 10 years ago.