【htaccess】SSL対応している携帯だけをHTTPS通信にリダイレクトする

ベリサインサーバ ID: 携帯端末 未対応機種一覧 (旧来仕様のサーバID)より、
該当機種はHTTP通信にするhtaccessを作成しました。

auで「このサイトは安全でない可能性があるため接続できません」と表示される場合に有効です。

これをコピペして.htaccessに保存後、
モバイルがアクセスするサイトに設置します。
HTTP通信でアクセスしてきた携帯に対して、該当機種以外の場合はHTTPS通信にリダイレクトします。

2011/02/17 auのユーザーエージェントが違ったので修正しました。
2011/02/18 auの場合SSL通信はEZサーバを経由してサーバに来るので、対応していないものは、httpにアクセスするように変更しました。

ベリサインSSL非対応機種一覧

htaccessのダウンロードはこちら

RewriteEngine On
#*************DOCOMO 第2世代*************
RewriteCond %{HTTP_USER_AGENT} “!D211i”
RewriteCond %{HTTP_USER_AGENT} “!D251i”
RewriteCond %{HTTP_USER_AGENT} “!D251iS”
RewriteCond %{HTTP_USER_AGENT} “!D252i”
RewriteCond %{HTTP_USER_AGENT} “!D253i”
RewriteCond %{HTTP_USER_AGENT} “!D503i”
RewriteCond %{HTTP_USER_AGENT} “!D503iS”
RewriteCond %{HTTP_USER_AGENT} “!D504i”
RewriteCond %{HTTP_USER_AGENT} “!D505i”
RewriteCond %{HTTP_USER_AGENT} “!D505iS”
RewriteCond %{HTTP_USER_AGENT} “!D506i”
RewriteCond %{HTTP_USER_AGENT} “!F211i”
RewriteCond %{HTTP_USER_AGENT} “!F212i”
RewriteCond %{HTTP_USER_AGENT} “!F251i”
RewriteCond %{HTTP_USER_AGENT} “!F503i”
RewriteCond %{HTTP_USER_AGENT} “!F503iS”
RewriteCond %{HTTP_USER_AGENT} “!F504i”
RewriteCond %{HTTP_USER_AGENT} “!F504iS”
RewriteCond %{HTTP_USER_AGENT} “!F505i”
RewriteCond %{HTTP_USER_AGENT} “!F505iGPS”
RewriteCond %{HTTP_USER_AGENT} “!F506i”
RewriteCond %{HTTP_USER_AGENT} “!F661i”
RewriteCond %{HTTP_USER_AGENT} “!F671iS”
RewriteCond %{HTTP_USER_AGENT} “!F672i”
RewriteCond %{HTTP_USER_AGENT} “!Music PORTER”
RewriteCond %{HTTP_USER_AGENT} “!N211i”
RewriteCond %{HTTP_USER_AGENT} “!N211iS”
RewriteCond %{HTTP_USER_AGENT} “!N251i”
RewriteCond %{HTTP_USER_AGENT} “!N251iS”
RewriteCond %{HTTP_USER_AGENT} “!N252i”
RewriteCond %{HTTP_USER_AGENT} “!N253i”
RewriteCond %{HTTP_USER_AGENT} “!N503i”
RewriteCond %{HTTP_USER_AGENT} “!N503iS”
RewriteCond %{HTTP_USER_AGENT} “!N504i”
RewriteCond %{HTTP_USER_AGENT} “!N504iS”
RewriteCond %{HTTP_USER_AGENT} “!N505i”
RewriteCond %{HTTP_USER_AGENT} “!N505iS”
RewriteCond %{HTTP_USER_AGENT} “!N506i”
RewriteCond %{HTTP_USER_AGENT} “!N506iS”
RewriteCond %{HTTP_USER_AGENT} “!N506iSII”
RewriteCond %{HTTP_USER_AGENT} “!R211i”
RewriteCond %{HTTP_USER_AGENT} “!R692i”

#*************第3世代 au*************
RewriteCond %{HTTP_USER_AGENT} “!CA3D”
RewriteCond %{HTTP_USER_AGENT} “!TS39”
RewriteCond %{HTTP_USER_AGENT} “!SA37”
RewriteCond %{HTTP_USER_AGENT} “!CA36”
RewriteCond %{HTTP_USER_AGENT} “!CA34”
RewriteCond %{HTTP_USER_AGENT} “!CA3B”
RewriteCond %{HTTP_USER_AGENT} “!HI3F”
RewriteCond %{HTTP_USER_AGENT} “!ST33”
RewriteCond %{HTTP_USER_AGENT} “!KC3A”
RewriteCond %{HTTP_USER_AGENT} “!MA35”
RewriteCond %{HTTP_USER_AGENT} “!SN3I”
RewriteCond %{HTTP_USER_AGENT} “!SN3F”
RewriteCond %{HTTP_USER_AGENT} “!SN3J”
RewriteCond %{HTTP_USER_AGENT} “!SH38”
RewriteCond %{HTTP_USER_AGENT} “!TS3K”
RewriteCond %{HTTP_USER_AGENT} “!TS3N”
RewriteCond %{HTTP_USER_AGENT} “!SH36”
RewriteCond %{HTTP_USER_AGENT} “!CA31”
RewriteCond %{HTTP_USER_AGENT} “!CA32”
RewriteCond %{HTTP_USER_AGENT} “!TS32”
RewriteCond %{HTTP_USER_AGENT} “!HI35”
RewriteCond %{HTTP_USER_AGENT} “!TS33”
RewriteCond %{HTTP_USER_AGENT} “!SA35”
RewriteCond %{HTTP_USER_AGENT} “!CA33”
RewriteCond %{HTTP_USER_AGENT} “!HI36”
RewriteCond %{HTTP_USER_AGENT} “!SN34”
RewriteCond %{HTTP_USER_AGENT} “!SA36”
RewriteCond %{HTTP_USER_AGENT} “!HI37”
RewriteCond %{HTTP_USER_AGENT} “!SN36”
RewriteCond %{HTTP_USER_AGENT} “!ST31”
RewriteCond %{HTTP_USER_AGENT} “!CA35”
RewriteCond %{HTTP_USER_AGENT} “!HI38”
RewriteCond %{HTTP_USER_AGENT} “!HI38”
RewriteCond %{HTTP_USER_AGENT} “!KC37”
RewriteCond %{HTTP_USER_AGENT} “!SN37”
RewriteCond %{HTTP_USER_AGENT} “!SA38”
RewriteCond %{HTTP_USER_AGENT} “!TS36”
RewriteCond %{HTTP_USER_AGENT} “!KC38”
RewriteCond %{HTTP_USER_AGENT} “!KC3E”
RewriteCond %{HTTP_USER_AGENT} “!SN38”
RewriteCond %{HTTP_USER_AGENT} “!TS37”
RewriteCond %{HTTP_USER_AGENT} “!TS38”
RewriteCond %{HTTP_USER_AGENT} “!TS3A”
RewriteCond %{HTTP_USER_AGENT} “!CA37”
RewriteCond %{HTTP_USER_AGENT} “!HI39”
RewriteCond %{HTTP_USER_AGENT} “!KC39”
RewriteCond %{HTTP_USER_AGENT} “!MA31”
RewriteCond %{HTTP_USER_AGENT} “!SN39”
RewriteCond %{HTTP_USER_AGENT} “!SA39”
RewriteCond %{HTTP_USER_AGENT} “!SH32”
RewriteCond %{HTTP_USER_AGENT} “!TS3B”
RewriteCond %{HTTP_USER_AGENT} “!CA38”
RewriteCond %{HTTP_USER_AGENT} “!HI3A”
RewriteCond %{HTTP_USER_AGENT} “!MA32”
RewriteCond %{HTTP_USER_AGENT} “!SN3A”
RewriteCond %{HTTP_USER_AGENT} “!SA3A”
RewriteCond %{HTTP_USER_AGENT} “!SH33”
RewriteCond %{HTTP_USER_AGENT} “!TS3C”
RewriteCond %{HTTP_USER_AGENT} “!CA39”
RewriteCond %{HTTP_USER_AGENT} “!HI3B”
RewriteCond %{HTTP_USER_AGENT} “!KC3B”
RewriteCond %{HTTP_USER_AGENT} “!SN3B”
RewriteCond %{HTTP_USER_AGENT} “!ST32”
RewriteCond %{HTTP_USER_AGENT} “!TS3D”
RewriteCond %{HTTP_USER_AGENT} “!SN3C”
RewriteCond %{HTTP_USER_AGENT} “!SA3B”
RewriteCond %{HTTP_USER_AGENT} “!TS3E”
RewriteCond %{HTTP_USER_AGENT} “!TS3G”
RewriteCond %{HTTP_USER_AGENT} “!TS3H”
RewriteCond %{HTTP_USER_AGENT} “!CA3A”
RewriteCond %{HTTP_USER_AGENT} “!HI3C”
RewriteCond %{HTTP_USER_AGENT} “!KC3D”
RewriteCond %{HTTP_USER_AGENT} “!MA33”
RewriteCond %{HTTP_USER_AGENT} “!PT33”
RewriteCond %{HTTP_USER_AGENT} “!SN3D”
RewriteCond %{HTTP_USER_AGENT} “!SA3C”
RewriteCond %{HTTP_USER_AGENT} “!SH34”
RewriteCond %{HTTP_USER_AGENT} “!TS3I”
RewriteCond %{HTTP_USER_AGENT} “!HI3D”
RewriteCond %{HTTP_USER_AGENT} “!MA34”
RewriteCond %{HTTP_USER_AGENT} “!SN3E”
RewriteCond %{HTTP_USER_AGENT} “!ST34”
RewriteCond %{HTTP_USER_AGENT} “!SH35”
RewriteCond %{HTTP_USER_AGENT} “!TS3J”
RewriteCond %{HTTP_USER_AGENT} “!CA3C”
RewriteCond %{HTTP_USER_AGENT} “!HI3E”
RewriteCond %{HTTP_USER_AGENT} “!SA3D”
RewriteCond %{HTTP_USER_AGENT} “!KC3B”
RewriteCond %{HTTP_USER_AGENT} “!SN3G”
RewriteCond %{HTTP_USER_AGENT} “!KC3K”
RewriteCond %{HTTP_USER_AGENT} “!SA3E”
RewriteCond %{HTTP_USER_AGENT} “!SH37”
RewriteCond %{HTTP_USER_AGENT} “!TS3L”
RewriteCond %{HTTP_USER_AGENT} “!KC3I”
RewriteCond %{HTTP_USER_AGENT} “!TS3M”
RewriteCond %{HTTP_USER_AGENT} “!Xmini”

#*************第3世代 docomo*************
RewriteCond %{HTTP_USER_AGENT} “!D2101V”
RewriteCond %{HTTP_USER_AGENT} “!SH900i”

#*************WILLCOM*************
RewriteCond %{HTTP_USER_AGENT} “!AH-J3001V”
RewriteCond %{HTTP_USER_AGENT} “!AH-J3002V”
RewriteCond %{HTTP_USER_AGENT} “!AH-J3003S”
RewriteCond %{HTTP_USER_AGENT} “!WX220J”

#*************docomoその他*************
RewriteCond %{HTTP_USER_AGENT} “!F1100”
RewriteCond %{HTTP_USER_AGENT} “!HT-01A”
RewriteCond %{HTTP_USER_AGENT} “!HT-02A”
RewriteCond %{HTTP_USER_AGENT} “!HT1100”

#*************EMOBILE*************
RewriteCond %{HTTP_USER_AGENT} “!Dual Diamond”
RewriteCond %{HTTP_USER_AGENT} “!EMONSTOR”
RewriteCond %{HTTP_USER_AGENT} “!Touch Diamond”

#*************SoftBank*************
RewriteCond %{HTTP_USER_AGENT} “!X01T”

#*************WILLCOM*************
RewriteCond %{HTTP_USER_AGENT} “!W-ZERO3”

#*************SSLのでない時*************
RewriteCond %{HTTPS} off

#*************アクセスのあったURLへリダイレクト*************
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]