18
11

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 1 year has passed since last update.

[WordPress][Nginx] プラグイン SiteGuard のログインURL変更機能を Nginx で使う

Last updated at Posted at 2018-04-02

SiteGuardってプラグインのログインURL変更機能を使うと、.htaccess に以下の設定が追加されます。
login-xxxx はプラグインの設定画面で設定したログイン用のURL。

#SITEGUARD_PLUGIN_SETTINGS_START
#==== SITEGUARD_RENAME_LOGIN_SETTINGS_START
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    RewriteRule ^wp-signup\.php 404-siteguard [L]
    RewriteRule ^wp-activate\.php 404-siteguard [L]
    RewriteRule ^login-xxxx(.*)$ wp-login.php$1 [L]
</IfModule>
#==== SITEGUARD_RENAME_LOGIN_SETTINGS_END
#SITEGUARD_PLUGIN_SETTINGS_END

Webサーバが Nginx の場合は、.htaccess が有効にならないので、以下のような感じで設定追加しましょう。
単純に Nginx の rewrite に書き換えただけ。

rewrite ^/wp-signup\.php$ /404-siteguard break;
rewrite ^/wp-activate\.php$ /404-siteguard break;
rewrite ^/login-xxxx(.*)$ /wp-login.php$1 break;
18
11
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
18
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?