S
S
Serge Tkach2017-03-27 17:11:45
opencart
Serge Tkach, 2017-03-27 17:11:45

How to properly configure https on OpenCart 2.3?

The Internet is full of absolutely useless articles on this topic, which do not even come close to helping solve the problem

Problem:
When you enable https in the config + admin panel, the admin panel really works buzzing. But the showcase does not work with the https protocol

Pay attention to system/library/url.php

public function link($route, $args = '', $secure = false) {


And there is a condition:
if ($this->ssl && $secure) {
      $url = $this->ssl . 'index.php?route=' . $route;
}


...
I wanted to ask myself if https is enabled, but it returns false when accessing the config from the showcase
$this->config->get('config_secure'); // return false


Closed the issue like this:
public function link($route, $args = '', $secure = true) {


+ added to .htaccess:
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://prod.e-web.loc/$1 [R=301,L]


And everything seems to be working!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2018-05-21
@CB9TOIIIA

Thank you! + also helped me: https://microdata.pro/opencart-dev/https-ssl-encrypt

R
RHCk, 2018-06-08
@RHCk

I translated my sites to SSL / TLS according to this guide.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question