Htaccess protection for all except some directory and files

Discussion in 'Programming/Scripts' started by Alexander01, Feb 7, 2017.

  1. Alexander01

    Alexander01 New Member

    sorry how i protect /admin folder except the subfolder /admin/articles

    This htaccess code in /admin not work correctly:

    AuthType Basic
    AuthName "Panel admin"
    AuthUserFile "/path/.htpasswds/public_html/admin/passwd"
    require valid-user
    <Directory /admin/articles/>
    Order Deny,Allow
    Allow from all

    I await your news, thanks ;)
  2. Try to setup SetEnvIf

    SetEnvIf Request_URI "(/directory/subdir/)$" allow
    SetEnvIf Request_URI "(dir/file\.php)$"  allow
    Order allow,deny
    Allow from env=allow
    Satisfy any
    danny94 likes this.

Share This Page