Sat 3 Oct 2009
Trouble with Hotlink Protection and HTTP Referer in Different Browsers
Posted by luar under Flash[9] Comments
To save bandwidth, most of servers will practice some hotlink protection, usually using either following script to check whether the HTTP referer is come from the same server, most script are focus on image file, but it can slightly modified for FLV protection. There are two common methods to do that:
Edit in .htaccess RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteRule \.(flv|mp3)$ - [NC,F,L]
Edit in httpd.conf, first enabled this:
LoadModule setenvif_module modules/mod_setenvif.so
then put it inside <VirtualHost>, just before </VirtualHost>
SetEnvIfNoCase Referer "^http(s)?://(www\.)?yourdomain.com(/|$)" local_ref=1
SetEnvIfNoCase Referer "^$" local_ref=1
<FilesMatch "\.(flv|mp3)">
Order Allow,Deny
Allow from env=local_ref
</FilesMatch>
However, FLV need to play through Flash Player, different browsers and even minor versions handle plugin HTTP referer differently, so it make such hotlink protection through HTTP referer means impossible
| Browser | sends the URL of the requesting plug-in (i.e. the best situation, url of SWF) | does not send a referer | sends the embedding page URL |
| IE | X | ||
| Firefox | X | ||
| Safari (MAC) | X | ||
| Safari (Win) | X | ||
| <Chrome 3 | X | ||
| Chrome 3+ | X | ||
| <=Opera 9 | X | ||
| Opera 10+ | X |
The hotlink protection cause problem when you let other people embed your video player in their site (like Youtube do), from the above table, you can find the third column will not work, for example in safari (MAC), the video cannot play because Apache think the FLV is linked by third party website and forbid FLV to be accessed.

October 4th, 2012 at 9:36 pm
Do you accomplish have a spam glitch about this website; I as well am the blogger, and I was asking your circumstance; we allow us some fine methods and we have been looking to trade methods with other persons, please assume me a enormous e-mail proviso interested.
February 6th, 2013 at 6:06 pm
Bagus banget.. Warnanya cocok dan gak terlalu mencolok.. ngeliat ijo2 jadi adem.. kontennya juga bermutu, tentang go green.. nice website.. creative & goodjooobbb.. ^^
February 7th, 2013 at 12:43 pm
RSS Feeds in your weblog oftentimes rule isn’t followed.
February 8th, 2013 at 1:51 pm
Hello to every one, the contents existing at this site are genuinely amazing forpeople experience, well, keep up the good work fellows.
March 12th, 2013 at 5:40 am
I feel that is among the so much important info for me. And i am glad reading your article. But should remark on few basic issues, The site style is wonderful, the articles is really nice
. Good task, cheers.
April 3rd, 2013 at 10:47 am
Ha! Perfectly seen. Thanks for the laugh this morning.
April 10th, 2013 at 12:42 pm
I useԁ to be able to find good infо from your articles.
My ωeblog … Leandro
April 19th, 2013 at 4:19 pm
Hello there, I found your blog by means of Google even as searching for a similar topic, your web site came up, it appears great. I have bookmarked it in my google bookmarks.
May 16th, 2013 at 3:06 pm
I’m really impressed with your writing talents and also with the layout on your weblog. Is this a paid subject or did you modify it your self? Either way keep up the excellent quality writing, it is rare to peer a great weblog like this one today..