SSL opencart 2.2.0.0, css file load wrong path.
Posted: Tue Dec 20, 2016 3:38 am
that's bunch of thing i do for SSL in opencart V. 2.2.0.0
1.
Settings->Server) and changed the HTTPS configurations in the main config.php and admin/config files
define('HTTP_SERVER', 'https://uwlcd.com/');
define('HTTPS_SERVER', 'https://uwlcd.com/');
2.
system/config/catalog.php and system/config/admin.php.
$_['site_ssl'] = false;
$_['site_ssl'] = true;
3.
system/library/url.php
if ($this->ssl && $secure) {
$url = 'https://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/.\\') . '/index.php?route=' . $route;
} else {
$url = 'https://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/.\\') . '/index.php?route=' . $route;
}
4.
admin/controller/sale/order.php (fix the problem admin unable edit the order through SSL)
850 line changed to
$data['store_url'] = $this->request->server['HTTPS'] ? str_replace("http", "https", $order_info['store_url']) : $order_info['store_url'];
$data['store_url'] = str_replace("httpss://", "https://", $data['store_url']);
after all I do in the top. the css won't show correct in my product :
https://uwlcd.com/iphone4-4s-lcd-screen ... -lcd-black
-----------------------------------------------------------------------------------------
I aslo try some method from forum to fix this , but don't work for me:
1.
I try
catalog/controller/common/header.php on line 27
$data['base'] = $server;
to
$data['base'] = "//mydomain.com";
or
$data['base'] = $server . '/';
2.
catalog/controller/common/header.php on line 17
if ($this->request->server['HTTPS']) {
$server = 'https://'.$this->config->get('site_base');
} else {
$server = $this->config->get('config_url');
}
those 2 won't work for me .
everyone have any idea about how to fix it.
1.
Settings->Server) and changed the HTTPS configurations in the main config.php and admin/config files
define('HTTP_SERVER', 'https://uwlcd.com/');
define('HTTPS_SERVER', 'https://uwlcd.com/');
2.
system/config/catalog.php and system/config/admin.php.
$_['site_ssl'] = false;
$_['site_ssl'] = true;
3.
system/library/url.php
if ($this->ssl && $secure) {
$url = 'https://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/.\\') . '/index.php?route=' . $route;
} else {
$url = 'https://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/.\\') . '/index.php?route=' . $route;
}
4.
admin/controller/sale/order.php (fix the problem admin unable edit the order through SSL)
850 line changed to
$data['store_url'] = $this->request->server['HTTPS'] ? str_replace("http", "https", $order_info['store_url']) : $order_info['store_url'];
$data['store_url'] = str_replace("httpss://", "https://", $data['store_url']);
after all I do in the top. the css won't show correct in my product :
https://uwlcd.com/iphone4-4s-lcd-screen ... -lcd-black
-----------------------------------------------------------------------------------------
I aslo try some method from forum to fix this , but don't work for me:
1.
I try
catalog/controller/common/header.php on line 27
$data['base'] = $server;
to
$data['base'] = "//mydomain.com";
or
$data['base'] = $server . '/';
2.
catalog/controller/common/header.php on line 17
if ($this->request->server['HTTPS']) {
$server = 'https://'.$this->config->get('site_base');
} else {
$server = $this->config->get('config_url');
}
those 2 won't work for me .
everyone have any idea about how to fix it.