Forum Moderators: phranque

Message Too Old, No Replies

Prevent hotlinking except for one directory

         

blang

2:30 pm on Mar 26, 2010 (gmt 0)

10+ Year Member



I have anti-hotlinking set up in our top level htaccess file, and it works great. What I'd like to know is, can you designate another directory somewhere to allow images to be linked externally? I've built a newsletter system so we can send out multipart HTML/plain text newsletters to our customers, and of course we want the users that access their email with markup to be able to view the images in them without getting "BANDWIDTH THIEF!111".
;-)

Perhaps a subdomain is the solution...

jdMorgan

12:56 am on Mar 27, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Using either a subdomain or a specific URL-path-part (what you refer to as a 'directory' above) is acceptable.

Simply exclude this hostname (subdomain) or URL-path-part from your anti-hotlinking rule.

Jim

londrum

10:01 am on Mar 27, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



or you could just put a second .htaccess file in that directory, which changes the permissions.

blang

8:42 pm on Mar 27, 2010 (gmt 0)

10+ Year Member



Thanks for the replies. Any pointers on how the RewriteRules should look to reverse the anti-hotlink?