View Single Post
Old 2004-04-16, 01:30 PM   #12
stev0
You tried your best and you failed miserably. The lesson is 'never try'
 
stev0's Avatar
 
Join Date: Mar 2004
Location: Calgary
Posts: 165
Send a message via ICQ to stev0
Use an htaccess file like this

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://([a-z0-9-]+\.)*yourdomain.com(:80)*/ [NC]
RewriteCond %{HTTP_REFERER} !^http://([a-z0-9-]+\.)*allowedreferer.com(:80)*/ [NC]
RewriteCond %{HTTP_REFERER} !^http://([a-z0-9-]+\.)*anotherallowedreferer.com(:80)*/ [NC]
RewriteCond %{HTTP_COOKIE} !(^|(.+*)id=valid(;.*|$)
RewriteRule /* http://www.sendhotlinkershere.com[R,L] )

change the URLs obviously...

then, on the content page serving the videos, add this javascript between the HEAD tags.

<SCRIPT LANGUAGE="javascript">
// Calculate the expiration date
var expires = new Date ();
expires.setTime(expires.getTime() + 24 * 60 * 60 * 1000);
document.cookie = "id=valid; path=/" + "; expires=" + expires.toGMTString();
</SCRIPT>


....

that javascript will create a cookie (which is one of the access conditions in that htaccess). So the videos will work after the user views the content page, and be hotlink protected.
stev0 is offline   Reply With Quote