'Giovanni

Member
Feb 13, 2008
9
1
51
I want to do a .htaccess redirect from https to http and from non www to www, can anyone help me with the correct code?
 

vanessa

Well-Known Member
PartnerNOC
Sep 26, 2006
833
28
178
Virginia Beach, VA
cPanel Access Level
DataCenter Provider
To force http:

Code:
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}
To force www:

Code:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{http_host} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
Hello :)

Please follow the steps listed in the previous post. Feel free to let us know the outcome.

Thank you.
 

'Giovanni

Member
Feb 13, 2008
9
1
51
It does the redirect on http from non www to www but on ssl if i access https:// domain.com it redirects me to another domain (not domain.com) and for https:// www. domain.com it shows the warrning atempt reach etc. and if i proceed, again goes to other domain

:confused:
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
Hello :)

Are you sure a valid SSL certificate has been installed for this domain name, and it's not utilizing another certificate for another domain on a shared IP address?

Thank you.