I am trying to redirect the addon domain (including all its pages) from http://mysite.com to https://mysite.com .

I tried a bunch of options.

Nothing works because cyclic redirection occurs.

At the same time, http://www.mysite.com is redirected to https://www.mysite.com perfectly.

Solution Used:

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST}#%{HTTPS}s ^www\.([^#]+)#(?:off|on(s)) [NC] RewriteRule ^ https%2://%1%{REQUEST_URI} [R=301,L] </IfModule> 

How to redirect http://mysite.com to https://mysite.com ?

  • Clarification: At the same time http: //www.mysite .com is redirected perfectly not to https: //www.mysite .com, but to https: // mysite .com - Mila

1 answer 1

The server administrator gave the decision, who can come in handy. This solution redirects the domain with a BBB and without a BBB to the same address https:

 RewriteEngine on RewriteCond %{ENV:HTTPS} !on RewriteRule (.*) https://mysite.com%{REQUEST_URI}