Already turned on 'Force HTTPS redirect' under 'Domains' but one addon domain (static site) is not redirecting

webhostinguser

Registered
May 3, 2019
4
0
1
Kuala Lumpur
cPanel Access Level
Website Owner
Hello lovely boys and girls, I'd appreciate some help with this little bump I'm having.

I use WordPress for all my primary and addon domains, except for one of my sites, which is a static html + css + js site.

In cPanel I went to 'Domains' and turned on 'Force HTTPS Redirect' for my primary domain.

All my WordPress addon domains correctly inherit the HTTPS status from my primary domain.

However, the addon domain that has the static site is not redirecting to HTTPS.

Upon checking the htaccess for that site, this is the code that appears:

Code:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
Header always set Content-Security-Policy "upgrade-insecure-requests;"
It should therefore work, but it isn't. I have a feeling that to solve the problem I have to manually edit or include something in my static site's index.html or css files but I don't really know what to do.

Please help and thank you in advance.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,252
313
Houston
Hello,


Can you run the following from a CLI that is not associated with the server:

curl -vv http://youraddondomainname.tld

And paste the output in a response here, just ensure you remove any actual domain names or IP addresses
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,252
313
Houston
There are sites out there like this one Run Curl Commands Online that will let you copy-paste your request in and provide you output. If you do use this one, please provide the Raw output in response. If you're uncomfortable doing this I'd suggest you contact your hosting provider for assistance.