Forum Moderators: phranque

Message Too Old, No Replies

CNAME Hotlink Protection?

         

Magaman

3:56 am on Dec 23, 2010 (gmt 0)

10+ Year Member



Hi eveyrone, found these forums through a google search was hoping I could get some insight. I've been running a site and recently started using Amazon S3 for hosting images. A lot of our images started getting hotlinked and killing our bandwidth. While its not a big deal with S3 I was wondering about how I could protect those images as well. I understand how to set-up hotlink protection and it works for anything stored on our server.
Now with S3 I have a CNAME set-up (img.domain.com) I figured that would then fall under the hotlink protection as it's seen as a subdomain, but it does not. From reading S3 documentation they offer a crazy way of limiting access but no true hotlink protection. Is there any tricks that I could maybe use?

Thanks

wilderness

7:38 pm on Dec 23, 2010 (gmt 0)

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



Perhaps I'm missing something?

Why not just add an htaccess file to the root folder of "img.domain.com" (where the CNAME points), and add whatever lines you desire?

You may have a seperate htaccess for as many sub-folders of each website (s) as you desire. Each with different options,
That is if you need that much complexity and have that much time to waste, keeping everything functioning and coordinated.

Magaman

10:57 pm on Dec 23, 2010 (gmt 0)

10+ Year Member



img.domain.com lives on Amazon S3 the CNAME points to their servers. It doesn't have a subdomain folder on my server.

wilderness

11:44 pm on Dec 23, 2010 (gmt 0)

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



Isn't domain.com your domain?

jdMorgan

3:43 pm on Jan 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The anti-hotlinking code --in fact, any image-related code-- will have to be placed on the server where those images are stored and requested from.

Jim