Reputation: 6672
Is there any way that I can hide the image filenames for all products on a website so that, even if someone chooses to view the page source or image properties, they can't? I need a way to hide the filenames because in some cases they contain information that i dont want to display to the public.
Upvotes: 0
Views: 671
Reputation: 449683
Renaming the files and giving them some random name would the simplest way to go.
If that's not an option, using a PHP frontend as @SLaks shows is the second-simplest way to go. It's a bit resource consuming, but okay if you don't have a lot of traffic.
If you do have a lot of traffic and are a bit advanced with Apache, you could also consider using an RewriteMap
. It makes Apache to look up URL substitutions from a text file, which is faster than passing the resource through PHP. It will require some fiddling to get it to work, though.
Upvotes: 0
Reputation: 3631
You can use different techniques, e.g. use md5 function to generate a hash for image file name and store the images in any directory, push their path info in database and then get from database..
Upvotes: 0
Reputation: 887797
You can make a PHP script that takes an opaque image ID, finds the corresponding image, and writes it out to the response stream.
Thus, the image URLs on the client would look like ../Image.php?ID=<something useless>
.
Remember to set the Content-Type
.
Upvotes: 2