Forum Moderators: phranque

Message Too Old, No Replies

Unviewable SubDirectory

hidden

         

nucleocide

12:43 am on Jan 28, 2005 (gmt 0)



Lets say that my servers root folder is C:\server. In that directory, there is a subdirectory called private. I would like to make it so that people cannot enter that folder. How would I go about doing this?

jdMorgan

2:43 am on Jan 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Usual practice would be to place your web content into a subdirectory called "httpdocs" (arbitrary name) in the same directory as "private" and then set DocumentRoot to /server/httpdocs. In this way, an HTTP request can't "go above" the /httpdocs directory.

Alternatively, you can password-protect the /private directory. See the Apache Authorization and Authentication tutorial (see link in our forum charter).

Jim