You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Bishop, Dean" <de...@tcdsb.org> on 2002/12/10 19:20:32 UTC

RE: [users@httpd] how do i leave only DocumentRoot open; all othe r directories require Auth

Cool thanks Jacob.  i actually thought of the single branch idea after
posting.  Good to hear that i am not nuts.

later,
dean

-----Original Message-----
From: Jacob Coby [mailto:jcoby@listingbook.com]
Sent: Tuesday, December 10, 2002 1:06 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] how do i leave only DocumentRoot open; all
other directories require Auth


> i am trying to set up a site in such a way that everything requires
> Authentication with the sole exception of the DocumentRoot.

hmm..

> The only option i can see is to create .htaccess files for every
> directory in my site _except_ my DocumentRoot.

One option is to make the rest of your site live off of a single branch of
the document root, and have the .htaccess with the auth requirements in it.
.htaccess files are recursive in nature, so if it doesn't find one in ., it
looks in ../, and then ../../ until it reaches document root.

So, you would have:

www.example.com/index.html
www.example.com/site/everything_else.html

Anything you try to access from /site/* will require auth since there is a
.htaccess in /documentroot/auth, but your index.html should be allowed out
to everyone.

Another option is to use virtual hosts, and have www.example.com be publicly
available, but have www.auth.example.com require authorization.

-Jacob


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org