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でお問い合わせフォームとサンキューページにSSL(自分用メモ)

Last updated at Posted at 2014-07-01

お問い合わせフォームとサンキューページにSSLを設定
-ローカル vhosts

  • http -> 80

  • https -> 443

    • 2箇所記入 追加コード
  • プラグインを使用

  • .htaccessでhttpsとhttpの設定を記入をしようとしたがWordPressの設定が優先されうまくいかない

  • HTTPSのプラグインを停止

  • header.phpに設定を記入
    <?php if ($_SERVER['REQUEST_URI'] == '/contact/index/' && empty($_SERVER['HTTPS'])) { header("Location: https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"); exit; } elseif ($_SERVER['REQUEST_URI'] == '/thanks/' && empty($_SERVER['HTTPS'])) { header("Location: https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"); exit; } elseif ($_SERVER['REQUEST_URI'] !== '/contact/index/' && $_SERVER['REQUEST_URI'] !== '/thanks/' && $_SERVER['HTTPS'] === 'on') { header("Location: http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"); } ?>

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?