How to hide entire subfolder

Avatar
  • updated
  • Answered

Sorry, I asked this once but lost the answer. How can I hide an entire sub-folder? For example if I have

website.com/folder_a, how would I prevent showing the index for it, or just not show it at all  (error 404). I may have

/folder_a/sub-folder_1/ and

/folder_a/sub-folder_2

that both contain files I would keep for specific people.

How would I hide the /folder_a from visitors to my site, but at the same time allow a download a file from that, as in

/folder_a/sub-folder_1/getthisfile.zipx

I promise to keep the answer this time!

Avatar
jamesgun

Hi,

Thanks for writing me back. I thought I would get some sort of notification when somebody responded to this, but I didn't, or I would have written back sooner.

I thought I had things set up so that someone could type in www.leapingware.com/downloads and get a 404 message, but type in www.leapingware.com/downloads/antelope.jpg and be able to download that file. I must have been mistaken, thank you though.

Avatar
IMH Support Agent 2
  • Answered

Hello,


Thanks for your questions about hiding the folder from access and allowing access to only specific people.  You can use the .htaccess file for either of these of things.  The main issue is how do you deny access to only specific people?  You can block by IP address or a range of IP addresses, but it's very easy for a person to use a different IP address.

So, the best thing is to only allow access to a file using a password.  You can then limit access to a specific file in a folder. If you do this and also prevent the listing of your website folders, then you can specify access to specific people. 


I hope that helps to answer your question! If you have any further questions, please let us know!

Kindes regards,

Arnel C.