htaccessでSSL対応

ファイル数少ない場合(SSL領域がディレクトリで分かれていない場合)

RewriteEngine on

RewriteCond %{REQUEST_URI} .*/form.php$ [OR]
RewriteCond %{REQUEST_URI} .*/confirm.php$ [OR]
RewriteCond %{REQUEST_URI} .*/comp.php$
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

RewriteCond %{REQUEST_URI} .*/index.html$ [OR]
RewriteCond %{REQUEST_URI} .*/index02.html$ [OR]
RewriteCond %{REQUEST_URI} .*/index03.html$
RewriteCond %{HTTPS} on
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R,L]

参考にしたページ
http://www.meibinlab.jp/nishijima/archives/54

投稿者:

ayako0802

フロントエンドエンジニア