Page 1 of 1

SSL / HTTPS reverts to regular HTTP after admin login

Posted: Fri May 20, 2016 1:24 pm
by opencartkorn
Hi,

1. After logging in via /admin with SSL/HTTPS, it reverts to regluar HTTP://
2. If i prefix HTTPS:// it goes back to SSL/HTTPS...

I have followed the steps to setup SSL properly, and the store works with SSL if i point to HTTPS://
The admin login page also works with SSL, if i point to HTTPS://

It is only after logging in, it reverts to HTTP://, not HTTPS://

I have added HTTPS:// in both admin and store root config.php, what else is needed?

Any help would be appreciated.

Re: SSL / HTTPS reverts to regular HTTP after admin login

Posted: Fri May 20, 2016 7:00 pm
by paulfeakins
opencartkorn wrote:I have added HTTPS:// in both admin and store root config.php, what else is needed?
If you're sure you've added it correctly in config.php and /admin/config.php then it's probably your .htaccess file.

If you paste it here after blanking out any sensitive info we'll be able to tell ...

Re: SSL / HTTPS reverts to regular HTTP after admin login

Posted: Mon May 23, 2016 12:00 pm
by harap
Change all http to htps for config files in both root and admin. This fixed same problem in my case.

Force redirect coding also needed in .htaccess

Re: SSL / HTTPS reverts to regular HTTP after admin login

Posted: Wed Sep 07, 2016 7:09 am
by StitchnBe
Please help, I am having the same issue but solutions offered have not worked. I am running 2.2.0.0. Problem is as follows for me:

Unable to force ssl on opencart

Steps taken
1) Turned "Use SSL" on in settings under server
2) Changed the config.php file to "define('HTTP_SERVER', 'https://<myurl.com>/');" as well as image and admin

It still doesn't force https.

What else can we try?

Re: SSL / HTTPS reverts to regular HTTP after admin login

Posted: Wed Sep 07, 2016 5:05 pm
by ADD Creative
Have you changed the config.php in the admin directory?

Re: SSL / HTTPS reverts to regular HTTP after admin login

Posted: Thu Sep 08, 2016 6:48 am
by StitchnBe
ADD Creative wrote:Have you changed the config.php in the admin directory?
Yes but it started throwing "error undefined" messages and I lost ability to process orders from the admin dashboard. It also turned all the icons to squares and failed to show the map and sales analytics. We had to go back to how it was before that fix to restore admin functions.

Re: SSL / HTTPS reverts to regular HTTP after admin login

Posted: Thu Sep 08, 2016 10:28 pm
by ADD Creative
So what are your HTTP_SERVER and HTTPS_SERVER (and depending on version HTTP_CATALOG and HTTPS_CATALOG) set to in your admin config.php?

Re: SSL / HTTPS reverts to regular HTTP after admin login

Posted: Fri Sep 09, 2016 8:14 am
by StitchnBe
ADD Creative wrote:So what are your HTTP_SERVER and HTTPS_SERVER (and depending on version HTTP_CATALOG and HTTPS_CATALOG) set to in your admin config.php?
Using Version 2.2.0.0. The settings are:

// HTTP
define('HTTP_SERVER', 'http://www.mystore/admin/');
define('HTTP_CATALOG', 'http://www.mystore.com/');
define('HTTP_IMAGE', 'http://www.mystore.com/image/');
// HTTPS
define('HTTPS_SERVER', 'https://www.mystore.com/admin/');
define('HTTPS_CATALOG', 'https://www.mystore.com/');
define('HTTPS_IMAGE', 'https://www.mystore.com/image/');

Re: SSL / HTTPS reverts to regular HTTP after admin login

Posted: Fri Sep 09, 2016 6:31 pm
by ADD Creative
Seem some of the code for the URLs was changed for 2.2.0.0 and then changed back for 2.3.0.0. See https://github.com/opencart/opencart/co ... 9834fa061f

You can't just make these changes as things have changed in the index.php or framework.php. But you may be able to get it working by looking at other versions.

The is also a topic on it here. http://forum.opencart.com/viewtopic.php?t=159011

Re: SSL / HTTPS reverts to regular HTTP after admin login

Posted: Sun Sep 11, 2016 6:24 am
by StitchnBe
ADD Creative wrote:Seem some of the code for the URLs was changed for 2.2.0.0 and then changed back for 2.3.0.0. See https://github.com/opencart/opencart/co ... 9834fa061f

You can't just make these changes as things have changed in the index.php or framework.php. But you may be able to get it working by looking at other versions.

The is also a topic on it here. http://forum.opencart.com/viewtopic.php?t=159011

Thanks for your reply. I am not a developer and those links made my head hurt. Wondering if I would be better off upgrading to 2.3.0.2...would that be a simpler solution to my issue?

Re: SSL / HTTPS reverts to regular HTTP after admin login

Posted: Tue Sep 13, 2016 5:58 pm
by ADD Creative
Looks like it was fixed in 2.3 onwards, so upgrading may help. Remember to backup your files and database before any attempt to upgrade. You could also try upgrading a test copy of your site first to check if it fixes the issue or introduces any other issues.