...

View Full Version : htaccess conditional based on user



nicky
04-25-2011, 09:27 PM
I was wondering if it's possible to program a htaccess conditional based on users?

My directory is password protected, but based on the user login, I'd like the Options +Indexes to turn turn if it's an admin user, or be Options -Indexes if it's a regular user. There are a bunch of directories within this directory, and the regular users need to be able to access those, but I don't want them seeing the directory listing if they go to the main directory.

Does this make sense? :P

I'd appreciate all and any help.

oesxyl
04-25-2011, 10:22 PM
I was wondering if it's possible to program a htaccess conditional based on users?

My directory is password protected, but based on the user login, I'd like the Options +Indexes to turn turn if it's an admin user, or be Options -Indexes if it's a regular user. There are a bunch of directories within this directory, and the regular users need to be able to access those, but I don't want them seeing the directory listing if they go to the main directory.

Does this make sense? :P

I'd appreciate all and any help.
as far as i know Options is not allowed in htacces so you can't use it to change Indexes.
Is not clear from what you said if password protection of directories is done using a apache mode, basic, digest or you use another way, script based for example.
Also is not clear if you have or not access to the server configuration.

Anyway take a look to the mod_authz_owner maybe is what you want.

http://httpd.apache.org/docs/2.2/mod/mod_authz_owner.html

best regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum