Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

restrict access to everything but the default-document

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Attempt to redirect - can it be done, or implemen..  
Author Message
pzesar

External


Since: Oct 26, 2004
Posts: 1



(Msg. 1) Posted: Tue Oct 26, 2004 8:31 am
Post subject: restrict access to everything but the default-document
Archived from groups: alt>apache>configuration (more info?)

i want to restrict access to everything in a directory with basic
authentication. this works.
i also want everybody to be able to see the default document of the
directory (index.htm in this case) without being prompted for
authentication. this also works.

what i came up with is a .htaccess-file looking like this:

# start of .htaccess
<Files index.htm>
allow from all
satisfy any
</Files>

AuthUserFile PATH-TO-.HTPASSWD
AuthName Name
AuthType Basic
require user USERNAME
# end of .htaccess

this works if i call up www.foo.bar/index.htm
but it does not if i call www.foo.bar/

how can i exclude the directory-root (or whatever this is called) from
authentication so that a visitor could be redirected to the
unprotected default-document?
currently, if i call www.foo.bar/ it asks for authentication and if
correct displays the unprotected index.htm - otherwise a 403 error -
but i want it to display index.htm without authentication and without
calling the explicit URL of index.htm

i'm thankful for any hints,
patrick

 >> Stay informed about: restrict access to everything but the default-document 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 2) Posted: Tue Oct 26, 2004 3:47 pm
Post subject: Re: restrict access to everything but the default-document [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2004-10-26, Patrick Zesar <pzesar DeleteThis @gmail.com> wrote:
 > how can i exclude the directory-root (or whatever this is called) from
 > authentication so that a visitor could be redirected to the
 > unprotected default-document?

The problem is in the way apache retrive the default document, to do so
he first have to 'scan' the directory, to 'scan' the directory he need
to read all the files in it, to do so, he need authorization. Hence the
authorization window. Unless you hack into mod_auth I don't see a real
option here.

Davide

--
Linux: the dot in "dot org". -- From a Slashdot.org post<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: restrict access to everything but the default-document 
Back to top
Login to vote
notvalid

External


Since: Jul 15, 2004
Posts: 33



(Msg. 3) Posted: Tue Oct 26, 2004 6:19 pm
Post subject: Re: restrict access to everything but the default-document [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Davide Bianchi wrote:

 > On 2004-10-26, Patrick Zesar <pzesar.TakeThisOut@gmail.com> wrote:
  >> how can i exclude the directory-root (or whatever this is called) from
  >> authentication so that a visitor could be redirected to the
  >> unprotected default-document?
 >
 > The problem is in the way apache retrive the default document, to do so
 > he first have to 'scan' the directory, to 'scan' the directory he need
 > to read all the files in it, to do so, he need authorization. Hence the
 > authorization window. Unless you hack into mod_auth I don't see a real
 > option here.
 >
 > Davide
 >
You could put index.html in document-root and make a subdir under that. put
everything else in the subdir and protect that subdir.
Eric<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: restrict access to everything but the default-document 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 4) Posted: Tue Oct 26, 2004 7:50 pm
Post subject: Re: restrict access to everything but the default-document [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2004-10-26, Eric <notValid.TakeThisOut@comcast.net> wrote:
 > You could put index.html in document-root and make a subdir under that. put
 > everything else in the subdir and protect that subdir.

Agree. And it's what I'd do. But this is not what the OP wants...
Davide

--
Sysadmins don't go to hell; we're already doing our time in purgatory.
--Peter deFriesse<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: restrict access to everything but the default-document 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Restrict access to localhost only - I want to prevent access to a specific directory with a .htaccess file. Only the local PHP module should be allowed to access that directory. I've put a .htaccess file in the directory: <Directory /> Order Deny,Allow Deny from all Allow from (se...

Default Document Problem - Hello All, I've got Apache 2 setup with PHP and NewAtlanta's Bluedragon. I'm trying to create a virtual site that uses coldFusion. I have another that uses php. My http.conf entry for default documents looks like this: <font..

Apache default document loading - How can I force apache2 to load diferent document from index.php .html? I want apache to load after puting http adres www.baz.org php document with parameters for example ../index?start=23 .

how to change default document by domain ? - Hi, I have 2 domains : mydomain.com and mydomain.net On my server, all files are in /home/mydomain/ I want that the .net arrive on index_net.php and the .com on index_com.php These files initialize variables and then redirect to index.php. How to do..

restrict ssl - I want to restrict a directory containing cgi scripts to only be accessed via https.
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]