リダイレクトで色々なパターンを書くことも多く、基本的でかつよくありそうなものを例に書いておきます。
HTTPSの全アクセスをHTTPに変更する。
[html]
RewriteCond %{HTTPS} on
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
[/html]
HTTPの全アクセスをHTTPSに変更する。
[html]
RewriteCond %{HTTP} on
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
[/html]
特定のページはhttpsのままで、それ以外のページをhttpにリダイレクトする
[html]
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/foo/* [OR]
RewriteCond %{REQUEST_URI} ^/bar/*
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
[/html]
特定のページはhttpのままで、それ以外のページをhttpsにリダイレクトする
[html]
RewriteCond %{REQUEST_URI} ^/foo/* [OR]
RewriteCond %{REQUEST_URI} ^/bar/*
RewriteCond %{HTTPS} on
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R,L]
[/html]
以上、メモでした。