Excluding a directory from a higher-ranking .htaccess file

This is a discussion on Excluding a directory from a higher-ranking .htaccess file within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, I need to know if its possible to exclude password-protection on a specific directory using a .htaccess file. ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-16-2003
Martin Sørensen
 
Posts: n/a
Default Excluding a directory from a higher-ranking .htaccess file

Hi,

I need to know if its possible to exclude password-protection on a specific
directory using a .htaccess file.

I'm not admin on the server and has to use .htaccess files to control the
pages, eventhough I know it would be smarter to set up some rules in
httpd.conf.
I have a .htaccess file in the root that makes sure the user is asked for
login and password before allowing any access to any
subdirectories/subpages. This works as it should.

Now I need a subdirectory to be completely excluded from the previous
..htaccess, allowing anybody to view the page without asking for passwords.
Is this possible?

I've made several attempts to override the root .htaccess file in many ways,
but it has never worked at all. Has anyone done anything similar and can
point me in the right direction?

signing off.. Martin Sørensen


  #2 (permalink)  
Old 08-16-2003
Michael Newton
 
Posts: n/a
Default Re: Excluding a directory from a higher-ranking .htaccess file

Martin Sørensen wrote:

> Hi,
>
> I need to know if its possible to exclude password-protection on a specific
> directory using a .htaccess file.
>
> I'm not admin on the server and has to use .htaccess files to control the
> pages, eventhough I know it would be smarter to set up some rules in
> httpd.conf.
> I have a .htaccess file in the root that makes sure the user is asked for
> login and password before allowing any access to any
> subdirectories/subpages. This works as it should.
>
> Now I need a subdirectory to be completely excluded from the previous
> .htaccess, allowing anybody to view the page without asking for passwords.
> Is this possible?
>
> I've made several attempts to override the root .htaccess file in many ways,
> but it has never worked at all. Has anyone done anything similar and can
> point me in the right direction?
>
> signing off.. Martin Sørensen
>
>


I think the way .htaccess works is that it goes through each directory and
reads each .htaccess along the way, and adds up all the rules as it goes.So
probably what's happening is that the 'AuthType Digest' (or whatever) directive
in your root .htaccess file is given more importance than 'AuthType None'in
the directory that's further down the tree.

Just a guess though.
----
Michael Newton
http://mike.rancidcrab.com

  #3 (permalink)  
Old 08-17-2003
Martin Sørensen
 
Posts: n/a
Default Re: Excluding a directory from a higher-ranking .htaccess file

>> Now I need a subdirectory to be completely excluded from the previous
>> .htaccess, allowing anybody to view the page without asking for
>> passwords. Is this possible?

> I think the way .htaccess works is that it goes through each
> directory and reads each .htaccess along the way, and adds up all the
> rules as it goes.


From what I've read in the documentation, a new .htaccess file should
completely override a higher-level .htaccess, but from my tests, that
doesn't happen. It is more likely that the rules add up instead of replacing
the old, as you write.

> So probably what's happening is that the 'AuthType
> Digest' (or whatever) directive in your root .htaccess file is given
> more importance than 'AuthType None' in the directory that's further
> down the tree.
> Just a guess though.


Well, you may be right, but then I need to know how to override the
AuthType.

My root .htaccess file looks like this:
----
AuthUserFile /home/blabla/.htpasswd
AuthGroupFile /dev/null
AuthName Restricted
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>
----

signing off.. Martin Sørensen


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:27 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0