Click to See Complete Forum and Search --> : Would like some help with restricting access to images


Some1 Somewhere
04-20-2006, 09:26 PM
Well, from what I have read, the title probably has a few people raging already. :)
So, just to avoid some confusion, I'll state what I do know.

1. I don't care if someone wants to right click and save my image, and I don't care if someone wants to hit print screen. What they are getting in my opinion is trash to what I put online. 600 x 800 is dinky.

2. I know that you can .htaccess directories so that others can't access them without a password. Personally, I hate the idea of passwording site so that pictures can't be viewed. I know that you can restrict a directory so that only your domain can access it. The problem with this is that I have a java (not javascript) viewer. Resticting by domain makes it so that the image is not available to the java applet.

What I want to know is this. Can I restrict my image directory so that only my domain can access it, while still allowing the java applet to grab the images?

If you want to see the applet . . .

Dcameraman.com

Look on the left for the "Mountain Pics" or "Scenic Pics" links.

I hope that explains it well enough,

Josh

jshalcott
04-20-2006, 10:00 PM
the best way i know is making a redirect page. just make a .html page blank or it can say restricted or access denied or something like that, then to make it redirect add this code into your head section:

<meta http-equiv="refresh" content="5; URL=http://www.yoursite.com/">
Just change the content="5; and change the 5 to how long you want the visitor to stay at this page, and the URL=http://www.yoursite.com/" to the url to your homepage or what ever page you want it to redirect at. Now save this inside the directory of your images and name it index.html. so now every time some one goes to like a this http://www.yoursite.com/images they will be at the restricted page and then redirected. Here's a test (http://www.jeffatweb.byethost17.com/)
Just wait for about 10 seconde and you should end up at google. ;)

Some1 Somewhere
04-20-2006, 10:28 PM
Thanks for the quick reply.

Does that work if someone types in a direct link to the image? Or, does that only make it so that someone can't access the folder to see what's inside?

Josh

jshalcott
04-23-2006, 02:11 AM
sorry, but no it does not stop them from getting it if they type in the direct link. But most people look for the folder first and then will be sent to a page with all list of all the images and other files in that folder, so now they can access all the images. What I just showed you was just a way for now they have to figure out the exact name and type of the image

Some1 Somewhere
04-23-2006, 07:22 PM
OK. Well all anyone has to do is look at the source code and they can see not only what the image folder is, but what the image name is.

The folder is already protected. I need to know how to deny a direct url request.

Josh

skilled1
04-24-2006, 12:41 PM
you can have subfolders such as http://www.yoursite.com/images denied, however you can not deny http://www.yoursite.com/images/image.jpg because it is the file on your server. the only thing you can do is add scripting to the back end so someone can not link to it to use it on their website, but if someone finds the real location ofthe file they will always be able to view it.