環境
さくらのVPS CentOS 6.10
Apache/2.2.15
PHP 5.4.45
SSL化でwww無しのリダイレクトを実装。
お世話になります。
前回の以下質問が解決出来ていない状態なのですが。
https://teratail.com/questions/146663
現状で rewrite_log を確認しますと、以下のように not-matched の部分出ております。
(4) [perdir /var/www/html/] RewriteCond: input='on' pattern='off' => not-matched (4) [perdir /var/www/html/] RewriteCond: input='example.com' pattern='!^example\.com$' [NC] => not-matched
httpをhttpsに変換して、wwwありをwwwなしに統一する記述は以下です。
/etc/httpd/conf/httpd.conf 内に記述 RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^.*$ https://example.com%{REQUEST_URI} [R=301,L] RewriteCond %{HTTP_HOST} !^example.com$ [NC] RewriteRule ^.*$ https://example.com%{REQUEST_URI} [R=301,L]
ログに出ております not-matched の部分を matched にしたいのですが、どのような書き方になるでしょうか。
宜しくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/09/19 01:40
2018/09/19 03:25
2018/09/19 07:08