4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ベーシック認証の設定方法

Posted at

#1. .htaccessを設置
①ベーシック認証をかけるディレクトリに移動
②.htacccessファイルに以下を記述して保存

.htaccess
AuthUserFile .htpasswdを保存するパス/.htpasswd
AuthGroupFile /dev/null
AuthName "Input ID and Password."
AuthType Basic
require valid-user
<Files ~ "^.(htpasswd|htaccess)$">
deny from all
</Files>

#2. .htpasswdの設定

①パスワードの生成
http://www.luft.co.jp/cgi/htpasswd.php

にアクセス。IDとパスを入れて変換。

②.htpasswdの生成
.htaccessに記載されたパスの場所に移動
.htpasswdを以下の情報で保存

.htpasswd
変換された情報を入力
(例)test:vTaTkRSK8Mo

完了。

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?