Forum of Apache users Forum Index Forum of Apache users
Discussions of software for tuning the Apache web servers
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

.htaccess how to require authn for all files ina folder, be

 
Post new topic   Reply to topic    Forum of Apache users Forum Index -> General questions
View previous topic :: View next topic  
Author Message
pxshock



Joined: 27 Apr 2008
Posts: 1

PostPosted: Sun Apr 27, 2008 11:10 pm    Post subject: .htaccess how to require authn for all files ina folder, be Reply with quote

.htaccess how to require authn for all files ina folder, besids certain file extentns

.htaccess, how to require authentication for files in a folder, besides certian file extentions?

hey guys, been trying this for about 24 hours now, and im just really beat..Sad

im using apache2, and i been to a couple sites such as the apache doc site, and no help at all(as in nothing i try works). What i want to do is, require authencation for all files in a directory execpt certain files with a particular extention, allowing all files but some extentions.

so im attempting to add restriction for all files, and then trying to single out files with a particular extention and remove the require clause...not working though Sad

i have a folder with some jpgs in it, and some folders with other files, and also jpgs, i will be linking those jpgs from other sites, so i need then to not require authentication, however, all the other files in the doc root i need to set authentication for.

this is what i have so far.

<Directory /home/www/shared/>

<Files *>
AuthType Basic
AuthName "This is a restriced site"
AuthUserFile /pass/a
AuthGroupFile /pass/g
Require group GroupName
</Files>


#also tried saying overide none and placing the below in a .htaccess fle in the root dir
<FilesMatch "\.jpg$">
#<Files ~ "\.(jpg)$">
#<Files *.jpg>
Satisfy any
#Require none #i dont think this call (none) even exists, but i still tried it.
#Order deny,allow
Allow from all
#</Files>
</FilesMatch>


#some other config info here

</Directory>

can some please help me, or perhaps suggest a link, or a better solution to my problem

thankx in advance.
________
marijuana seed


Last edited by pxshock on Fri Feb 04, 2011 4:55 am; edited 1 time in total
Back to top
View user's profile Send private message
szimin
Site Admin


Joined: 01 Jun 2007
Posts: 58

PostPosted: Tue Apr 29, 2008 12:28 pm    Post subject: Reply with quote

How many different files extensions in this directory?
Mybe simply enumerate all the forbidden extensions like this:
<Files ~ "\.(jpg|gif)$">
AuthName "TOP SECRET ZONE"
AuthType Basic
AuthUserFile "/path/.htpasswd"
Require valid-user
</Files>
Back to top
View user's profile Send private message Visit poster's website
szimin
Site Admin


Joined: 01 Jun 2007
Posts: 58

PostPosted: Tue Apr 29, 2008 12:30 pm    Post subject: Reply with quote

or create the special directories for the secret files and for other
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Forum of Apache users Forum Index -> General questions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot 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


Powered by phpBB © 2001, 2005 phpBB Group

Anti Bot Question MOD - phpBB MOD against Spam Bots