奈良のひきこもり経験者の自助グループ
サイト、SSL化(HTTPS化)になりました。
ワードプレスの管理画面で、https://ohirudesu.com/にして、wp-config.phpの「編集が必要なのは…」の文の前に、
$_SERVER[‘HTTPS’] = ‘on’;
を追加。
.htaccessに、
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule ^/?(.*) https://%{HTTP_HOST}/$1 [R,L]
</IfModule>
を追加。
ワードプレスのテーマのソースのhttp://ohirudesu.com/の部分をhttps://ohirudesu.com/に変える。
これで完成。
参考サイト
・WEB – Usamimi.info
・WordPress設定をhttpsにしてるのにURLや挙動がおかしい! – ノウハウブログ – カンタローCGI
・エックスサーバーでWordpressをSSL化(https)する時に無限ループでハマった – Qiita
ちなみに、記事入力画面でhttp://ohirudesu.com/と打ったのに、記事でhttps://ohirudesu.com/と表示されるのを防ぐには、functions.phpに、
remove_filter( ‘the_content’, ‘wp_replace_insecure_home_url’ );
を追加する。
・Improved HTTPS detection and migration in WordPress 5.7 – Make WordPress Core
追記 2021年9月29日:共同ブログと、活動報告のページの各記事・各報告のhttp://ohirudesu.com/もhttps://ohirudesu.com/に変更する必要がありました。
2021年9月22日 水曜日 おいなり