###前提・実現したいこと
ZendFrameWork1系で開発したシステムで.htaccessを使用し、特定のモジュール以外をhttpsへリダイレクトしたい。
具体的には
http://hogehoge.com -> https://hogehoge.comへリダイレクトしたい
デフォルトモジュールのfooコントローラのbarアクション
http://hogehoge.com/foo/bar -> https://hogehoge.com/foo/barへリダイレクトしたい
nonsslモジュールのfooコントローラのbarアクション
http://hogehoge.com/nonssl/foo/bar nonsslモジュールはリダイレクトしたくない
###現状
lang
1RewriteEngine On 2 3RewriteCond %{REQUEST_FILENAME} -s [OR] 4RewriteCond %{REQUEST_FILENAME} -l [OR] 5RewriteCond %{REQUEST_FILENAME} -d 6RewriteRule ^.*$ - [NC,L] 7 8RewriteCond %{HTTPS} off 9RewriteCond %{REQUEST_URI} !^/nonssl 10RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L] 11 12RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::$ 13RewriteRule ^(.*)$ - [E=BASE:%1] 14RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
上記のように.htaccessに記載すると
http://hogehoge.com/foo/barは目的とおりhttpsへリダイレクトされる
http://hogehoge.com/nonssl/foo/barも目的とおりリダイレクトされない
しかし
http://hogehoge.comがhttpsへリダイレクトされません。
どのように記述すれば
トップページ(http://hogehoge.com)もリダイレクトされnonsslモジュールのみリダイレクトされないようにできるでしょうか?
よろしくお願いします。
###環境
OS:centos6
zendframework 1.12
php 5.3.3
apache 2.2.15
あなたの回答
tips
プレビュー