homepage Welcome to WebmasterWorld Guest from 54.145.238.55
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
htaccess or something else?
Secure directories dynamically.
V0oD0o

10+ Year Member



 
Msg#: 514 posted 11:11 am on Apr 10, 2003 (gmt 0)

Hi there,

Just came across this website and it looks like a great resource.

I have lots of URL's on my server and some of these URL's contain a directory called "/secure/pr".

What I need to do is to be able to secure this directory dynamically.

I was thinking about .htaccess, but that would involve putting a new .htaccess in each directory.

Ideally, I would like to add something to the server config, which says "Any request to a dir named 'pr' should be put through the mill and only allowed in if the IP address matches one in the list or a correct user and pass are given"

New sites are added all the time and the list of IP's and usernames passwords would change. This is where I think it is nto a good idea to use htaccess.

Any ideas?

Thanks in advance,

Mike Pearce

 

eaden

10+ Year Member



 
Msg#: 514 posted 10:28 am on Apr 16, 2003 (gmt 0)

if you put this :

<LocationMatch "^.*/secure/pr/.*$">
AuthType Basic
AuthName "Secret"
AuthUserFile /var/www/somewhere/.htpasswd
Require valid-user
</LocationMatch>

in your apache.conf, then any requests for /secure/pr would have password auth. this will work across all virtual domains.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved