3
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.

WordPress のログインページに Basic 認証

Last updated at Posted at 2014-04-08

最近、ロリポップで運用している WordPress に対して断続的に攻撃がありました。
具体的には、「wp-login.php に対し、複数回のログイン試行が確認されました。」(ロリポップからのメールより)というもの。
ロリポップでは、この攻撃を受けると自動的に .htaccess を書き換えて、管理画面にアクセス出来ないようにしてくれるのですが、それで対応されてしまうと .htaccess を書きなおさないと正規のユーザもログインできなくなってしまいます。
そこで、BASIC認証をかけることで、BASIC認証とwp-loginの二段構えにすることにしました。

.htaccess
<Files wp-login.php>
AuthName	"Input ID & Password"
AuthType	Basic
AuthUserFile	/full/path/to/.htpasswd
Require	valid-user
</Files>

.htaccess ファイルは、wp-login.php と同じ場所に置きます。

.htpasswd ファイルは htpasswdファイル作成 などを見て作ってください。

3
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
3
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?