开发者

http site doesn't forward to https on IE

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 o开发者_如何学Cn how to fix IE?--that is make it go from http to https like the rest do?

Here is my config:

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

EDIT

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https:///%{SERVER_NAME}/$1 [R,L]


It look's like you have a extra slash in your rewrite rule, 3 slashes instead of 2 after https.

/Viktor


Hmmm... this seems to work for all browsers:

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜