Warning: array_values() expects parameter 1 to be array, null given in /home/hida-takayama/www/wp/wp-content/plugins/gutenberg/lib/compat/wordpress-6.4/script-loader.php on line 38

Warning: array_values() expects parameter 1 to be array, null given in /home/hida-takayama/www/wp/wp-content/plugins/gutenberg/lib/compat/wordpress-6.4/script-loader.php on line 39

Warning: array_values() expects parameter 1 to be array, null given in /home/hida-takayama/www/wp/wp-content/plugins/gutenberg/lib/compat/wordpress-6.4/script-loader.php on line 40

Warning: array_values() expects parameter 1 to be array, null given in /home/hida-takayama/www/wp/wp-content/plugins/gutenberg/lib/compat/wordpress-6.4/script-loader.php on line 41

Warning: Cannot modify header information - headers already sent by (output started at /home/hida-takayama/www/wp/wp-content/plugins/gutenberg/lib/compat/wordpress-6.4/script-loader.php:38) in /home/hida-takayama/www/wp/wp-content/plugins/all-in-one-seo-pack/app/Common/Meta/Robots.php on line 87

Warning: Cannot modify header information - headers already sent by (output started at /home/hida-takayama/www/wp/wp-content/plugins/gutenberg/lib/compat/wordpress-6.4/script-loader.php:38) in /home/hida-takayama/www/wp/wp-includes/feed-rss2.php on line 8
SSL | Constant stream of information https://www.hida-takayama.net I will continue to flow through the various information Sat, 04 May 2019 14:20:01 +0000 ja hourly 1 https://wordpress.org/?v=6.2.5 78711279 リダイレクト設定につまづく https://www.hida-takayama.net/2019/05/%e3%83%aa%e3%83%80%e3%82%a4%e3%83%ac%e3%82%af%e3%83%88%e8%a8%ad%e5%ae%9a%e3%81%ab%e3%81%a4%e3%81%be%e3%81%a5%e3%81%8f/ https://www.hida-takayama.net/2019/05/%e3%83%aa%e3%83%80%e3%82%a4%e3%83%ac%e3%82%af%e3%83%88%e8%a8%ad%e5%ae%9a%e3%81%ab%e3%81%a4%e3%81%be%e3%81%a5%e3%81%8f/#respond Fri, 03 May 2019 09:46:28 +0000 https://www.hida-takayama.net/wp/?p=2806 単純にリダイレクトすればいいかと 思ってた   前回、このブログはSSL化できた、と 書きました。 確かにできています。 httpsでアクセスすれば、ちゃんとSSL化 できているのはわかるんですが、 正確には、 … 続きを読む リダイレクト設定につまづく

The post リダイレクト設定につまづく first appeared on Constant stream of information.]]>
単純にリダイレクトすればいいかと

思ってた

 

前回、このブログはSSL化できた、と

書きました。

確かにできています。

httpsでアクセスすれば、ちゃんとSSL化

できているのはわかるんですが、

正確には、

http httpsのどちらにもアクセスできる状態になっています。

これをhttpsのみでアクセスできるようにすべく

http → httpsにリダイレクトさせたいのですが、

そのまえに、

httpで運用していたときに、

http:// → http://www

になるようにリダイレクトしていたようで・・・

もうややこしいことになっています(泣)

やろうとしていることを整理

  1. http://hogehoge.jp → http://www.hogehoge.jpに リダイレクトさせてある
  2. これをふまえて、http → https にリダイレクトさせたい

ということです。

 

それで調べてみてこれかなって思い、参考にできるかどうか思案しているサイトがこちら。

https://www.1-firststep.com/archives/3938

この方も、(たぶん)さくらインターネットのサーバーを使っているようでして、リダイレクトについては通常の設定ではリダイレクトは動かないということも説明されています。

これでいいのか?正直不安!

単純に、

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{ENV:HTTPS} !^on$
RewriteCond %{HTTP:X-SAKURA-FORWARDED-FOR} ^$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>

これをhtacsess(頭の部分にドットが入ります)に打ち込めばすべて解決なのでしょうか・・・・

さきほどいじろうとする前に、WordPress本体の、「設定」→「一般」から、サイトのアドレスをwwwを取って更新しようとしたらリダイレクトが多すぎると一時期アクセスできなくなってしまったのでちょっと焦ってます。

(ひとまずは、htacsessファイルをテキストにしてアクセスできるようにしてからもとに戻したので事なきを得ました)

さあ、どうなるのか、もうちょっといろいろと調べてみたいと思います。

 

~追記~2019.05.04

上記のコードをhtacsessに記述したら、すぐにリダイレクトがかかり、httpでアクセスするとhttpsにリダイレクトするようになりました。



The post リダイレクト設定につまづく first appeared on Constant stream of information.]]>
https://www.hida-takayama.net/2019/05/%e3%83%aa%e3%83%80%e3%82%a4%e3%83%ac%e3%82%af%e3%83%88%e8%a8%ad%e5%ae%9a%e3%81%ab%e3%81%a4%e3%81%be%e3%81%a5%e3%81%8f/feed/ 0 2806