I'm not even sure if this is possible; I'm on an apache server. For the file located at:
http://www.example.com/dir/img.jpg
- Allow this image to be loaded in a page called from that directory.
- Disallow this image to be loaded directly; ie. the url above should not load
- Prevent linking this image from a page located elsewhere
The purpose is the file should only be able to be displayed on the particular page its destined for; it should not be viewable directly. Can this be done?
From the Apache documentation: