Skip to content

Instantly share code, notes, and snippets.

@k-ish
Created October 9, 2018 06:40
Show Gist options
  • Save k-ish/b3dcc4fe79a086cd187fe8b975885f1a to your computer and use it in GitHub Desktop.
Save k-ish/b3dcc4fe79a086cd187fe8b975885f1a to your computer and use it in GitHub Desktop.
ベーシック認証の設定
AuthUserFile /home/path../.htpasswd
AuthGroupFile /dev/null
AuthName "Input ID and Password."
AuthType Basic
require valid-user
<Files ~ "^.(htpasswd|htaccess)$">
deny from all
</Files>
best:FS5DJ5U4pKCNI

-ベーシック認証をかけたいディレクトリに.htaccessと.htpasswdを設置 -そのディレクトリ配下のディレクトリ全てにベーシック認証がかかる -.htaccessの一行目のpath..の部分はドメインからの相対パス -.htpasswdの:左は、ID。:右は暗号化されたpw。pwの暗号化は、http://www.luft.co.jp/cgi/htpasswd.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment