Log in

View Full Version : .htaccess and sub directories



simonf
07-18-2007, 10:30 AM
Hi

I have a protected area with .htaccess/.htpasswd etc. I've made it an employee zone so only the staff can get is, however within this area I want to have other areas that are protected from most of the staff members but not all. For some reason I do not seem to be able to get this to work... am I just being dumb or can it not be done this way??:confused:

===> Employees (restricted access) ".htaccess#1"
---> Forms (all access)
---> HR (all access)
---> Manager Section (all access)
---> Area1 (limited access) Fred has access ".htaccess#2"
---> Files
---> Area2 (limited access) Jane has access ".htaccess#3"
---> Files
---> Area3 (limited access) Fred & Jane have access ".htaccess#4"
---> Files

Hope it makes sense and you guys can assist as always....

djr33
07-18-2007, 10:49 AM
From my limited knowledge of .htaccess, it applies to the directory is it in, and any subdirectories.
So you could limit 'staff' to staff only, 'staff/fred' to fred by having it limited to staff only, and within that folder .htaccess will specify it as only accessible to fred.

Seems pretty easy.

However, these things add up, I think. I'm not sure how you would make something within a protected directory not protected, etc.

I'm not sure about this, but it seems logical.

simonf
07-18-2007, 11:10 AM
Hi

This is the problem I have.. the main area is protected (get asked for users name and password etc) however when you go down to a another area which should be protected with another user/pass etc you do not get asked for the logon etc.

I.E both sections are protected... main areas you and I can get into, sub directory only you can have access to (i.e you have to login to that section again

djr33
07-18-2007, 11:22 AM
Yeah, I'm not really sure about more than that.
I'm pretty sure that .htaccess applies to inner directories, so consider that when figuring out how it works.
I think someone else can answer this question better than me.

simonf
07-18-2007, 02:54 PM
Resolved.. would anyone believe that it was a config on the IPS's Server!!

So please ignore this post.....