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.

 

 

 

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.