Certificate error when redirecting from www to non-www

Website URL

My test site mrfpmc-cip.ct.ws

(please specify the URL of the site on which you are experiencing the problem)

Error Message

(please share the FULL error message you see, if applicable)

Other Information

I put this code to .htacces file
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]

(other information and details relevant to your question)


Seems to be working fine for me.

Try clearing cache or using an incognito browser

2 Likes

URL mrfpmc-cip.ct.ws works fine is OK, but www.mrfpmc-cip.ct.ws - ERROR SSL and not redirected

Thats because Sub-Subdomains arn’t covered. please read:

all the details are in that post

a .htaccess rule like below can automatically redirect to without the www.

RewriteEngine On

# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Remove www.
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
7 Likes

Thank you

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.