How to hide entire subfolder

  • updated
  • Answered

Sorry, I asked this once but lost the answer. How can I hide an entire sub-folder? For example if I have, 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


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


I promise to keep the answer this time!



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 and get a 404 message, but type in and be able to download that file. I must have been mistaken, thank you though.

Arnel C
  • Answered


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.