###前提・実現したいこと
現在、通常は「https://example.com」のs有りで、サブドメインのみsなしの「http://sub.example.com」にリダイレクトさせたいのですが、https://sub.example.comを直接叩いてもhttpにリダイレクトしてくれません。
契約サーバの無料SSLを使用してますので、サブドメインはSSLを利用出来ないための処置です。
よろしくお願いします。
###ディレクトリ構成
public_html┬ index.php ├ .htaccess(1) └ sub(ディレクトリ) ├ index.html └ .htaccess(2)
###(1)の.htaccess
htaccess
1RewriteEngine on 2 3RewriteCond %{HTTPS} off [OR] 4RewriteCond %{HTTP_HOST} ^www\.example\.com 5RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
###(2)の.htaccess
htaccess
1RewriteEngine on 2 3RewriteCond %{HTTPS} on 4RewriteRule ^(.*)$ http://sub.example.com/$1 [R=301,L]

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/01/18 02:13