Post by devguy » Fri Dec 09, 2016 8:35 pm

I have defined HTTPS in my config for both frontend and admin.

Everything seems fine apart from the admin login form. Its action is pointed to the HTTP instead of HTTPS.

If I enable HTTP admin to login then switch to HTTPS everything is fine but when I define HTTPS everywhere the login form still points to HTTP so I can't log in due to mixed content.

What constant is used to determine the action URL of the login form?



Fri Nov 18, 2016 9:10 am

Post by thekrotek » Fri Dec 09, 2016 9:01 pm

Check your .htaccess - it might have HTTP redirection defined. Also check config.php and make sure, it points to HTTPS everywhere.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by

User avatar
Expert Member


Sun Jul 03, 2016 12:24 am

Post by devguy » Fri Dec 09, 2016 9:13 pm

The issue is the forms target is "".

.htaccess rules are applied by apache on requests, as far as I am aware it doesn't rewrite the actual HTML. All the config.php constant values point to HTTPS.

That is:

define('HTTP_SERVER', '');
define('HTTP_CATALOG', '');
define('HTTP_IMAGE', '');
define('HTTP_ADMIN', '');

define('HTTPS_SERVER', '');
define('HTTPS_CATALOG', '');
define('HTTPS_IMAGE', '');
define('HTTPS_ADMIN', '');

Did I miss any? I added this to admin config.php also.

I looked in the files that generate the form and it is populated by a variable "$action" so somewhere in the page lifecycle it is being set incorrectly. I think it is done by starter/router.php but I am not sure.

Everything else works fine. I could in theory hard code my sites link into the form but I would prefer to understand and fix the issue properly.



Fri Nov 18, 2016 9:10 am

Post by devguy » Sat Dec 10, 2016 12:01 am

I ran debugging session. On controller there is a value:


Anyone know the correct place to set it to true?



Fri Nov 18, 2016 9:10 am

Post by devguy » Sat Dec 10, 2016 12:50 am

I changed system/config/default.php and system/config/admin.php to site_ssl = true and now it works.

I find it weird that this is undocumented and couldn't find anything on this by googling but it seems to have done the trick.



Fri Nov 18, 2016 9:10 am

Post by IP_CAM » Fri Feb 10, 2017 9:13 am

I created a Listing, containing several VqMod/OcMod-Extensions, for different OC-Versions,
related to this - sometimes 'internally' not linked to HTTPS - Matter. They are untested, and
they come as they are, I cannot support anybody, because I don't use https yet! ::)
Good Luck ! ;)

Some HTTPS Helper Mod's for different OC Versions

I am no longer active at the OC Forum, to reach me, contact:
My latest free Opencart LIGHT Source is available on demand:
900+ FREE OC Extension-Repositories - from OC v.1.5.x up, on the
world's largest OC-related Github Site:

User avatar
Legendary Member


Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 35 guests