Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2008
    Location
    Michigan
    Posts
    216
    Thanks
    10
    Thanked 1 Time in 1 Post

    htaccess conditional based on user

    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.

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by nicky View Post
    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...thz_owner.html

    best regards


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •