The best solution would be
#Test if new browser and if so redirect to https #new browser is not MSIE 5-8, not Android 0-3, #not any symbian and not any blackbery RewriteCond %{HTTPS} off RewriteCond %{HTTP_USER_AGENT} !MSIE\ [5-8] [NC] RewriteCond %{HTTP_USER_AGENT} !Android.*(Mobile)?\ [0-3] [NC] RewriteCond %{HTTP_USER_AGENT} !^(.*.symbian.*) [NC] RewriteCond %{HTTP_USER_AGENT} !^(.*.blackberry.*) [NC] RewriteRule ^ https:
This ignores MSIE 5-8, which excludes all IE on XP, plus some that will work. But it allows XP with chrome, firefox, opera, all of which support SNI on XP. This at least allows XP users to use https. Similarly, he assumes that all Symbian, blackbery do not have sni. And this Android 3 does (what tablets tell me, phones need 4).
For another solution, you may have
#Could use this to set $_SERVER['SSL_TLS_SNI'] for php SetEnv SSL_TLS_SNI %{SSL:SSL_TLS_SNI}
This will install $ _SERVER ['SSL_TLS_SNI'] either in% {SSL: SSL_TLS_SNI} (yes, maybe the code is better) or in the domain name. If you know what the default certificate is, which apache returns and has access to this domain, then in other domains you can force php to execute test https in the default domain and then check $ _SERVER ['SSL_TLS_SNI'] to check SNI before switching to https.
Please note: there is no way to avoid the error message if the non-sni browser does https to the site that needs sni. The best you can do is
# Test if SNI will work and if not redirect to too old browser page RewriteCond %{HTTPS} on RewriteCond %{SSL:SSL_TLS_SNI} ="" RewriteRule ^ http:
The user must accept the browser error and go to the website, after which he is redirected to http and the error page.
malc_b
source share