Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kuniiskywalker/b17f46f883d43633ec5454cceff6ca90 to your computer and use it in GitHub Desktop.
Save kuniiskywalker/b17f46f883d43633ec5454cceff6ca90 to your computer and use it in GitHub Desktop.
.htaccess 特定の条件のみbasic認証を発動
SetEnvIf Request_URI "/ibaraki*" ibaraki
AuthUserFile /home/.htpasswd
AuthGroupFile /dev/null
AuthName "Input your ID and Password."
AuthType Basic
# 以下いずれかの条件がtrueの場合は認証要求なし
Satisfy any
# 条件1 :basic認証済の場合true
require valid-user
# 条件2 :/ibaraki以外はtrue
Order Deny,Allow
Deny from all
allow from env=!ibaraki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment