The code .htaccess below is working on all browsers, except for IE (I tested it on IE10 and IE11). The goal is to redirect all HTTP traffic to HTTPS, but IE seems to ignore it. Does IE need specific code?
# BEGIN GD-SSL
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_USER_AGENT} ^(.+)$
RewriteCond %{SERVER_NAME} ^domain\.com$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Header add Strict-Transport-Security "max-age=300"
</IfModule>
# END GD-SSL
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.+)$
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
On Firefox, Safari and Chrome if I access any of these:
http://domain.com
http://www.domain.com
https://www.domain.com
I am redirected to https://domain.com
On IE I am not redirected, or I am redirected to HTTP (not HTTPS).
Any ideas as to why?
RewriteCond %{HTTP_USER_AGENT} .*MSIE.*
You can try removing that, however be sure to delete all cache in your browser - IE is notorious for caching issues when testing SSL/HTTPS modifications.