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

Using .htaccess to make files public in password protected..

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  DirectoryIndex ignores entry, et al.  
Author Message
mitchuanospam

External


Since: Mar 25, 2004
Posts: 2



(Msg. 1) Posted: Thu Mar 25, 2004 4:07 am
Post subject: Using .htaccess to make files public in password protected directory
Archived from groups: alt>apache>configuration (more info?)

Right now I have a directory that has .htaccess:
DirectoryIndex index.php
AuthUserFile /home/mysite/.htpasswd
AuthGroupFile /dev/null
AuthName "Account"
AuthType Basic
require user fred
This password protects everything in that directory. However, I would like
to find a way to allow certain files to be not password protected. I don't
have access to httpd.conf so I'm stuck with these .htaccess files.

Here are some possibilities I came up with to identify the public files:
1) they must begin with "public"
2) they are in a subdirectory called "public"

#1 would work if I could figure out a regular expression that would get
everything EXCEPT filenames beginning with public. Something like
<Files ~ "\Apublic">
require user fred
</Files>
However, the \A from CPAN doesn't seem to work with .htaccess. Does anyone
have a reg ex that will do what I want?

#2 is a problem because .htaccess from the parent directory overrides
anything I do in subdirectories and I can't fix that in httpd.conf.

Is there a #3 I'm not seeing?

Thanks for your help.

--Mitchua

 >> Stay informed about: Using .htaccess to make files public in password protected.. 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 2) Posted: Thu Mar 25, 2004 11:03 am
Post subject: Re: Using .htaccess to make files public in password protected directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Mitchua <mitchuaNOSPAM.RemoveThis@hush.com> wrote:
 > to find a way to allow certain files to be not password protected.

Use the Satisfy directive in a <Directory > or <Location> block.
See the documentation about Satisfy.

Davide

--
| Never hit a man with glasses. Hit him with a baseball bat.
|
|
|<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Using .htaccess to make files public in password protected.. 
Back to top
Login to vote
mitchuanospam

External


Since: Mar 25, 2004
Posts: 2



(Msg. 3) Posted: Thu Mar 25, 2004 2:14 pm
Post subject: Re: Using .htaccess to make files public in password protected directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Davide Bianchi wrote:

 > Mitchua <mitchuaNOSPAM.TakeThisOut@hush.com> wrote:
  >> to find a way to allow certain files to be not password protected.
 >
 > Use the Satisfy directive in a <Directory > or <Location> block.
 > See the documentation about Satisfy.
 >
 > Davide
 >

<Directory> and <Location> are only available in server config,
not .htaccess. Is there any way to use Satisfy in an .htaccess?

I've tried something like this that just totally unprotects the directory
and everything in it:
Satisfy any
...
require user theuser
<Files public*>
Allow all
</Files>

Thanks for your help Davide.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Using .htaccess to make files public in password protected.. 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 4) Posted: Thu Mar 25, 2004 8:29 pm
Post subject: Re: Using .htaccess to make files public in password protected directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Mitchua <mitchuaNOSPAM.RemoveThis@hush.com> wrote:
 > not .htaccess. Is there any way to use Satisfy in an .htaccess?

I've been using Satisfy in .htaccess without any problem.

Try:

Allow from all
Satisfy any

Davide

--
| According to the obituary notices, a mean and unimportant person never
| dies.
|
|<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Using .htaccess to make files public in password protected.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
how to stop the password tries in the .htaccess protected .. - To improve the security and stop the password tries in the .htaccess protected folder, HOW can I disable a .htpasswd user if in a short time, this user's password has been typed in wrong for 10 times?

.htaccess / make files downloadable - Hello, I made a directory where a visitor can download some files (Apache on FreeBsd). Between these files are also html,txt,gif,jpg.... etc How can I make all those files "downloadable" so that they are not shown to the browser screen, but I...

.htaccess file for protecting user data and password files - Hello there, I've got a cgi-bin directory with some scripts. In one users' folder (users of a message board), plain text files contain info and passwords. The .htaccess file for this folder/directory reads: <Limit GET POST HEAD> order deny,allow...

Problem with access to password protected area - I have a directory selected with a .htaccess file in it. The following is the contents of the file AuthType Basic AuthName "Restricted Directory" AuthUserFile /usr/local/etc-http/.htpasswd Require valid-user I ...

Some newbie questions regarding using .htaccess for passwo.. - Apologies if this is the wrong group for this, I tried searching dejanews but was unable to narrow my search down enough to get anything useful. The scenario: Local soccer team wants a password protected directory on their site, we have found a host/ISP...
   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 ]