Password Protect a Folder

Discussion in 'General' started by abdi, Jul 8, 2013.

  1. abdi

    abdi Member

    Hello Everybody,

    I need some help ...
    Currently I am allowing authentication to the /administrator folder by (and this working fine for me):

    location /administrator {
    <tmpl_var name='web_document_root_www_proxy'>
    index index.html index.php;
    auth_basic "Members Only";
    auth_basic_user_file <tmpl_var name='stats_auth_passwd_file'>;
    }

    However, the problem with that is if a user installs say Joomla in a subfolder within root eg

    /joomla/ then that setting does not take effect.

    I would like to take effect to any administrator folder accessed via the web regardless of the folder level .

    Ie,

    www.domain.com/administrator
    www.domain.com/joomla/administrator
    www.domain.com/joomla/site2/administrator

    and etc ..

    ALL those should be authenticated based on my .htaccess file defined above.

    Please advice me on how I can modify the above directive to support that ...
     
  2. abdi

    abdi Member

    I think I have figured it out ...

    I used:

    Code:
    location ~*/(admin|administrator|wp-admin) {
     

Share This Page