Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
HotLink Protection Code Not Working Properly
Old 05-21-2007, 09:53 AM HotLink Protection Code Not Working Properly
Novice Talker

Posts: 6
Trades: 0
Recently I've been having a problem with excessive hotlinking of images from one of my sites. To try to solve the problem, I got the following code from a site called htaccesstools:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?treetrail.net [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.co.uk [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.ca [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?live.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?msn.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yahoo.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?ask.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?aol.com [NC]
RewriteRule \.(jpg|jpeg|gif)$ http://www.treetrail.net/Hotlink-Substitute-Image.png [NC,R,L]

In this code the sites after the ? in each line are supposed to be allowed access to the images. treetrail.net is my own site, and google, etc are search engines that I want to allow access for. Any site not included is supposed to be denied access. "Hotlink-Substitute-Image" is a small substitute image I created to send to hotlinkers instead of the image they want.

The code works to some extent. It denies access to all hotlinkers and it allows access to my own site. But the problem is that it denies access to Google Images (images.google.com), even though Google is on the list.
So my question is -- How can I allow access to Google Images while keeping everything else the same? Does anyone have a solution?
Thank you.
billybw is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-22-2007, 02:50 PM Re: HotLink Protection Code Not Working Properly
jefkin's Avatar
Novice Talker

Posts: 14
Name: Jeff
Location: in front of my computer
Trades: 0
add this line

Code:
RewriteCond %{HTTP_REFERER} !^http(s)?://(images\.)?google.com [NC]
below the line:

Code:
 RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
or better yet, replace the above line with

Code:
 RewriteCond %{HTTP_REFERER} !^http(s)?://(.*\.)?google.com [NC]
jefkin
jefkin is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to HotLink Protection Code Not Working Properly
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28416 seconds with 12 queries