htaccess を使用してページを https にリダイレクトしようとしています。同時に、他のページが http で動作するようにしたいと考えています。以下は私の .htaccess コードです。
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
# Turn SSL on for index.php
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{REQUEST_URI} \/trimmApp\/index\.php [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L]
# Turn SSL off everything exluding index.php (and some files used on index.php that need to serve through https only)
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{REQUEST_URI} !\/trimmApp\/index\.php [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [L]
HTTP から https へのリダイレクトは正常に行われますが、htpps は別のhttps://index.phpにリダイレクトされ、これが無期限に発生します。httpd.cong の AllowOveride 設定に関して、可能な限りすべてを試しました。
以下は私の書き換えログのスナップショットです:
10.x.x.x - - [24/Oct/2012:06:17:21 --0400] [xyz.com/sid#2b0c835afd70][rid#2b0c83a4cb90/initial] (4) [perdir /var/www/] RewriteCond: input='80' pattern='!^443$' => matched
10.x.x.x - - [24/Oct/2012:06:17:21 --0400] [xyz.com/sid#2b0c835afd70][rid#2b0c83a4cb90/initial] (4) [perdir /var/www/] RewriteCond: input='/check/ping.html' pattern='\/trimmApp\/index\.php' [NC] => not-matched
10.x.x.x - - [24/Oct/2012:06:17:21 --0400] [xyz.com/sid#2b0c835afd70][rid#2b0c83a4cb90/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/check/ping.html -> check/ping.html
10.x.x.x - - [24/Oct/2012:06:17:21 --0400] [xyz.com/sid#2b0c835afd70][rid#2b0c83a4cb90/initial] (3) [perdir /var/www/] applying pattern '^(.*)$' to uri 'check/ping.html'
10.x.x.x - - [24/Oct/2012:06:17:21 --0400] [xyz.com/sid#2b0c835afd70][rid#2b0c83a4cb90/initial] (4) [perdir /var/www/] RewriteCond: input='80' pattern='=443' => not-matched
10.x.x.x - - [24/Oct/2012:06:17:21 --0400] [xyz.com/sid#2b0c835afd70]
何が起こっているのかわかりません。助けていただければ幸いです。私のLinuxバージョンはCentos 5.6です