I'm working on a project, a little one. And I'll be interesting in disallow the direct access to files by URL.
Like you have a folder called "stock" where is situated all your images. You take the image cat, for example, and I want to disallow direct access to this file by this URL mysite.com/stock/cat.jpeg
But, in the same time, I want to be able to use these images on my website.
What is the best way to realise that ? I used .htaccess in the "stock" folder, with a Deny from all. But I wasn't able to use the file.
For the moment, I work on the localhost, but I'll put this live. And my framework (PHP) is CodeIgniter.
Thanks and have a good day :)