1
2

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.

Cloudflareを利用して運用しているWordPressのSSL化

Last updated at Posted at 2017-05-28

wpxサーバーにおいて、Cloudflareを利用して運用しているWordPressのSSL化を下記のURLに書かれている手順で設定を行った際、
https://www.wpx.ne.jp/cloud/manual/wordpress_setting_full_ssl.php
全てのページがリダイレクトループ(too many redirects)になってしまいました。

その場合の下記の手順1と2を行う必要があります。

手順1. wp-config.phpの一番最初に追記します。

// Cloudflare対策
if ( ! empty( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) {
    $_SERVER['HTTPS']='on';
}

手順2. Cloudflareの管理メニューのCrypto設定ページのSSL設定で
「Full」を選択します。
cloudflare.png

※参考サイト
https://1design.jp/web-development/1873

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?