copernicks — 2010-09-15T05:43:19-04:00 — #1
working on development of php application that can display images.
images are stored on server.
how can i protect images, so they can not be accessed outside my php application?
is that possible to do with .htaccess?
thank you in advance!
dklynn — 2010-09-15T08:38:00-04:00 — #2
However, the standard question deals with "piracy" and there is a pirate protection "script" in mod_rewrite just for that in the sticky threads and linked in my signature.
scallioxtx — 2010-09-15T06:27:32-04:00 — #3
There are two options:
1) Put the images in a directory below the DOCUMENT_ROOT
2) Put the images in a directory in the DOCUMENT_ROOT and put an .htaccess file in that directory with the following:
deny from all
With both options you need to serve the images using a php file because browsers won't be able to access the directly -- which is what you want