2
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で特定のディレクトリだけベーシック認証する

Posted at

WORDPRESSをインストールしてる時に、.htaccessしか仕えない状況が結構ある。

以下の例だと
/wp01/がwordpressのルート
2014のアーカイブはベーシック認証したいときに

apache
SetEnvIfNoCase Request_URI "^/wp01/2014/" SECURED
AuthType Basic
AuthName "My Protected Area"
AuthUserFile __HTPASSWD_FILE__
Require valid-user
Satisfy    any
Order      Allow,Deny
Allow from  all
Deny from env=SECURED

もちろん、普通にhttpasswdが使えて、mod_rewriteでパーマリンク設定してある必要がある

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