0

Possible Duplicate:
How to prevent hot linking (“image theft” / “bandwidth theft”) of ressources on my site?

I'd like to configure my Apache server similar to a working configuration I noticed on the Farming Simulator website. They use CSS background images for their main navigation bar but if you try to view an image with a direct link (example) it returns a 403 Forbidden error. I know how to allow/deny indexes for directories, but not how to deny access to files within those directories.

Does anyone know how I'd go about configuring .htaccess to work like this?

I found a similar question but it doesn't really answer mine.

Brack
  • 205
  • 2
  • 4
  • 8

1 Answers1

1

First I want to tell you that this is a very futile act. As soon as you see the image in your browser, it has been downloaded to your computer.

When I followed your link directly I had a 403. Then I visited the page and I could even see the image in the link because it was in the cache.

I believe this effect is produced by examining the referer of the request. A sample for blocking by referer can be found here

I still recomend you not to do it. Not many people try to hotlink a background image. And if they really want to, it's still easy to overcome this measure by simply changing the header.

Christopher Perrin
  • 4,741
  • 17
  • 32