Jump to content

Hot Linking question

Recommended Posts

I have read many topics here after searching. Read online also and still seem to be brain dead with hotlinking using htaccess.

I actually get it to work fine, but It filters out too much. 

First time using this code

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?http://myforumaddressdeletedhere.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ http://www.myotherwebsiteaddressforhotlinkimage.com/work/hotlink.jpg [NC,R,L]

First method Placing htaccess in the forum folder:
It worked fine returning a hotlink image to my blog which is on another server from any attached image. Problem is, on the test forum ALL attachments including markers, profile pictures,some icons for themes are also replaced with the hotlink image. 

Second Method: I moved uploads to "attachment directory created by me" and let the ACP do the moving:
I moved uploads to a folder called attachments then added the htacces to only the attachment folder I created and moved uploads to. This SOLVED the icon, profile pics etc and they show correctly now. Except any attachments I have in posts (graphics or pictures uploaded by members) show as hotlinked. Or any you add as uploads now.

How would I go about allowing members to upload and display what they uploaded but protect them from being hotlinked to.

Any help appreciated since I'm running out of Aspirin.


Link to comment
Share on other sites

Sorry, forgot to add this is the htaccess I am using 

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?http://beta.countrydepotforum.com.countrydepotforum.com/ [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ http://www.castlekeepdanes.com/work/hotlink.jpg [NC,R,L]

The test site is http://beta.countrydepotforum.com.countrydepotforum.com/

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...