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
留言