tags:

views:

754

answers:

2

Is there any way i can prevent hotlinking on Amazon S3 without using signed URLs?

+2  A: 

Not really. You could run an EC2 instance and proxy through that.

Joe Beda
+2  A: 

I use Apache RewriteMap to remap relative links to select file extensions -- *.jpg, *.gif, *swf, *.fla to Cloudfront. Basically makes the url of your images present as relative links to your site. It doesn't prevent discovery of the S3/cloudfront url totally, just adds a layer of difficulty for the would be thief.

Might be worth a try, apply the hotlink restrictions via htaccess with the above method in place. I haven't tried it myself.

Huh? Doesn't that mean that every image request has to go to your server before it can go to the CloudFront server? If so, doesn't that defeat the point of using a CDN? (It wouldn't for really big files like video, but for images?)
Doug McClean
The request will hit your web server and the browser is told where it should go to fetch the file, but the browser's history is never updated with the actual URL to the CDN.This is essentially the same trick behind "routes" in most front end controller frameworks, but in this case the request is never forwarded to the application server, only Apache.
Claude