Apache htaccess 限制某頁面要輸入密碼 Password

# Protected
AuthName "Protected Area"
AuthType Basic
AuthUserFile /path/.htpasswd
AuthGroupFile /dev/null

SetEnvIf Request_URI .* noauth
SetEnvIf Request_URI ^/某頁名稱連結 !noauth

<IfModule mod_authz_core.c>
    <RequireAny>
      Require env noauth
      Require valid-user
    </RequireAny>
</IfModule>

<IfModule !mod_authz_core.c>
    Order Deny,Allow
    Deny from all
    Satisfy any
    Require valid-user
    Allow from env=noauth
</IfModule>
# Protected END
Related posts 相關文章
不要在瀏覽器上自動儲存自己的密碼,已有人被駭
More...
htaccess redirect 重導 query string
More...
當 git clone 或 git pull 時就儲存帳密在當下不用再二次輸入
More...
perl 隨機產生 password 密碼
More...

作者

留言

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。