ログインしているすべてのユーザーに https を強制しようとしています。私のアプリのほとんどは、ユーザーがログインする必要がありますが、ログイン ステータスに応じて、http (ゲスト) と https (ログイン ユーザー) の両方を介して提供する必要があるページと、http のみにする必要があるページがまだたくさんあります。
私は Yii フレームワークを使用しており、ログインしているユーザーのすべてのページに https を強制しようとしています。ユーザーはモジュールを介して制御されます。
ここに私の現在の .htaccess があります
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
#RedirectMatch 301 ^/tk/(.*)$ http://admin.mysite.com/$1
#RewriteRule ([a-z0-9-]+)/? http://$1.mysite.com [R=301,NC,L]
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
#RewriteRule . index.php
RewriteRule .* index.php [QSA,L]