View Single Post
Old 01-18-2003, 05:16 AM  
MichaelH
Confirmed User
 
Join Date: Oct 2002
Location: Ever heard of Grunnn???
Posts: 130
A pure htaccess solution won't work against hotlinking (for the right-clicking). Actually, it would work (someone made me once one) but it will affect other things negatively as well.

There IS a solution with Javascript + htaccess like this one below :


This goes onto the pages you want to protect :

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

This goes into your htaccess :

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



But it's not 100% safe and even more important, most tgps & mgps ban javascript, so your galleries wouldn't even make it through the submission scripts.

There is another 100% effective solution, and you might want to contact me.


Michael
__________________
Fresh AND Converting : TRY and SEE the results for yourself! THIS will change your webmaster's life!
Protect yourself against MOVIE HOTLINKERS + EXCELLENT Hosting under 0.30/gig!
Page me on ICQ : 146920758 | QUALITY GALLERY SPOTS HERE
MichaelH is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote