Newsletter hotlink htaccess

hi all

i m using the below for hotlinks in htaccess file



RewriteCond %{HTTP_REFERER} !^http://(.+\\.)?domain\\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\\.(jpe?g|gif|bmp|png|swf)$ /images/nohotlink.jpe [L]


and i am creating a newsletter in the subfolder of my website.

if i use images path like


www.domain.com/images/logo.jpg

then all images show up fine in my newsletter in yahoo and hotmail email acounts.

but if i use images path of sub folder like


www.domain.com/launch/newsletter/images/logo.jpg

then my images dont show up in yahoo and hotmail acounts.

what can be the reason. do the hotlink code has anything to do with it.

vineet

vineet,

Indeed! Your {HTTP_REFERER} for both yahoo and hotmail is NOT your domain, it’s the e-mail message you sent. Go figure - it works as advertised!

Regards,

DK

hi dklynn

you mean that hotlink code is not the problem.

vineet

vinpkl,

No. I meant that the hotlink code IS the problem (when trying to add the images to an e-mail - when not attached TO the e-mail). The e-mail is NOT your domain so the request for the image (by the e-mail) will NOT be from your domain and will, thus, be rejected.

Regards,

DK

hi dklynn

is there any solution that can solve both my problems.

my images folder and .htaccess file both are in the root folder.

vineet

vinpkl,

Because your “specifications” are mutually exclusive, no, I don’t believe so. IMHO, you need to attach your images WITHIN the e-mail messages. After all, the only reason to link to your images is to log views and you’re preventing that via your e-mail so …

Regards,

DK

hi dklynn

also its not possible to set hotlinking to particular folder only, so that it dont interfere with all folder images.

if its possible then how.

vineet

vinpkl,

It IS possible but you’re asking how to hotlink when you’ve prohibited hotlinking. THAT is what’s not possible.

Regards,

DK

hi dklynn

i was trying to say that if i remove hotlinking code from the htaccess file which is in the root folder and put that code inside the images folder then will my problem be solved.

then only images folder images will have effect of hotlinking and other folder images will not be effected.

vineet

vinpkl,

:agree:

Regards,

DK