My client recently decided to switch all of his sub-domains to sub-directories (because SSL works fine on the sub-directories, but shows warnings on the sub-domains).
I have implemented 301 redirects (htaccess) on all subdomains. For the most part, this is all fine. However, IE (and other browsers for some people) seems to read the SSL before the redirect. So, IE shows a certificate error/warning and doesn't redirect.
For instance:
The following redirects fine for me in Firefox, but shows a certificate error/warning in IE:
[
mysubdomain.mydomain.com...]
The following redirects fine for me in Firefox and IE:
[
mysubdomain.mydomain.com...]
I have added various iterations of 301 redirects to the root of the account, the root of the main domain AND the root of the subdomain. I have even added PHP redirects to the one file that lives in the subdomain's root. No matter what I do, IE seems to deal with the SSL before the redirect. Does anyone know if there is a way to force IE (and any other browser that acts the same) to process the htaccess file BEFORE dealing with the SSL request?
Thanks!
Below are some of the redirect commands I've tried/am trying:
In the subdomain root:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTPS} on
RewriteRule ^(.*)$ [
mydomain.com...] [R=301,L]
RewriteEngine on
RewriteCond %{HTTPS} mysubdomain.mydomain.com$ [NC]
RewriteRule (.*)$ [
mydomain.com...] [R=301,L]
RewriteEngine on
RewriteCond %{HTTPS} mysubdomain.mydomain.com/index.php$ [NC]
RewriteRule (.*)$ [
mydomain.com...] [R=301,L]
RewriteEngine on
RewriteCond %{HTTP_HOST} [
mysubdomain.mydomain.com$...] [NC]
RewriteRule (.*)$ [
mydomain.com...] [R=301,L]
RewriteEngine on
RewriteCond %{HTTP_HOST} [
mysubdomain.mydomain.com...] [NC]
RewriteRule (.*)$ [
mydomain.com...] [R=301,L]
RewriteEngine on
RewriteCond %{HTTP_HOST} mysubdomain.mydomain.com$ [NC]
RewriteRule (.*)$ [
mydomain.com...] [R=301,L]
RewriteEngine on
RewriteCond %{HTTP_HOST} mysubdomain.mydomain.com/index.php$ [NC]
RewriteRule (.*)$ [
mydomain.com...] [R=301,L]
In the account root (above the main domain root -- this is where the non-SSL subdomain redirections live and work):
RewriteEngine on
RewriteCond %{HTTPS} mysubdomain.mydomain.com$ [NC]
RewriteRule (.*)$ [
mydomain.com...] [R=301,L]
RewriteEngine on
RewriteCond %{HTTPS} mysubdomain.mydomain.com/index.php$ [NC]
RewriteRule (.*)$ [
mydomain.com...] [R=301,L]
RewriteEngine on
RewriteCond %{HTTP_HOST} [
mysubdomain.mydomain.com$...] [NC]
RewriteRule (.*)$ [
mydomain.com...] [R=301,L]
RewriteEngine on
RewriteCond %{HTTP_HOST} [
mysubdomain.mydomain.com...] [NC]
RewriteRule (.*)$ [
mydomain.com...] [R=301,L]
RewriteEngine on
RewriteCond %{HTTP_HOST} mysubdomain.mydomain.com$ [NC]
RewriteRule (.*)$ [
mydomain.com...] [R=301,L]
RewriteEngine on
RewriteCond %{HTTP_HOST} mysubdomain.mydomain.com/index.php$ [NC]
RewriteRule (.*)$ [
mydomain.com...] [R=301,L]