Http to https behavior for visits from Internet Explorer client

Posted by Emile on Server Fault See other posts from Server Fault or by Emile
Published on 2011-01-16T06:49:01Z Indexed on 2011/01/16 6:54 UTC
Read the original article Hit count: 333

Filed under:
|
|
|
|

My website has an SSL cert (example url: https://subdomain.example.com). Under Apache it's set up for both port 80 and port 443. So under the following configuration, anyone who goes to http://subdomain.example.com is sent to https://subdomain.example.com . But for visits from Internet Explorer, the redirect doesn't happen. Instead, http visits get a "Internet Explorer cannot display the web page." with a list of client-side solutions to try.

Any ideas on how to fix the config so IE visits have the same behavior as the other browsers (that is, send http to https automatically)?

NameVirtualHost *:443

<VirtualHost *:80>
  DocumentRoot /var/www/somewebroot
  ServerName subdomain.example.com
</VirtualHost>

<VirtualHost *:443>
     DocumentRoot /var/www/somewebroot
     ServerName subdomain.example.com
    #   SSL CERTS HERE
</VirtualHost>

*Tested IE8, IE9 beta

© Server Fault or respective owner

Related posts about linux

Related posts about apache