Jump to content

[SOLVED] How do I prohibit direct linking to a directory... without password problems?


vozzek

Recommended Posts

Hi all,

 

Let's say I've got a directory at www.mywebsite.com/images/  and this contains all my site's images.  Obviously I don't want people being able to link directly to that directory and see the different files there, I want them to get an 'error not found' message or something along those lines.

 

So I went into my host panel (I use HostGator) and clicked 'password protect directories'.  This works, except that every single page of my site then asks for a username/password because the page is accessing the images from that directory.  So that's not gonna work.

 

Is there an html way to do what I want?  Thanks in advance.

 

 

 

Very cool, thanks much.  I definitely want to stop the hotlinking.

 

Still, could I put an index.html file in the directories I want to protect, with a re-direct back to my main page?  Wouldn't that protect the individual directory from being looked at?

 

And would web-browsers frown upon such multiple index pages and/or redirects?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.