Hi,
I am having trouble setting up my OC 2.2 store to use HTTPS. I am struggling for the past week with this and cannot seem to fix it.
I have done the following things in order to set up HTTPS:
1. Edited config.php in admin and root and added HTTPS to HTTPS_Server/image/catalog (not to HTTP as that will make the site unusable. reasons below)
2. Edited admin.php and catalog.php from system/config/ and have set "$_['site_ssl']" to "true"
3. Enabled in admin store settings to Use SSL.
The problem is that HTTPS only works if they are not ending in a forward slash, and if they are in the format of
> https://*.com/page
example:
> https://*.com/page <- works
> https://*.com/product <- works
> https://*.com/page/ <- does not work
> https://*.com/product/ <- does not work
> https://*.com/parent-category/page/2 <- does not work
> https://*.com/parent-category/sub-cat/ <- does not work
> https://*.com/parent-category/product <- does not work
note:
- all these pages are working when in HTTP
- all pages are SEO friendly and have keywords
If anyone can give me an idea or where to look to make these pages load even in HTTPS it would be greatly appreciated.
Thank you !
I have managed to fix the problem myself.
It turns out when in HTTPS the base href was set to nothing ("") which meant .js, .img and other files to be accessed from the wrong place.
I eddited catalog/controller/common/header.php on line 27
from:
to:
for some reason the if statement:
Does not work in my case. If anyone has this problem, this is the solution.
Regards
It turns out when in HTTPS the base href was set to nothing ("") which meant .js, .img and other files to be accessed from the wrong place.
I eddited catalog/controller/common/header.php on line 27
from:
Code: Select all
$data['base'] = $server;
Code: Select all
$data['base'] = "//mydomain.com";
Code: Select all
if ($this->request->server['HTTPS']) {
$server = $this->config->get('config_ssl');
} else {
$server = $this->config->get('config_url');
}
Regards
Last edited by straightlight on Wed Jul 27, 2016 2:38 am, edited 2 times in total.
Reason: Added code tags.
Reason: Added code tags.
This solution worked for me, but....
I'm changing a core file (i'd prefer not to) and
I can only use either www.mydomain.com or mydomain.com. The other no longer works.
Can anyone tell me how to fix this without messing up the two things above?
Thanks,
Matt
I'm changing a core file (i'd prefer not to) and
I can only use either www.mydomain.com or mydomain.com. The other no longer works.
Can anyone tell me how to fix this without messing up the two things above?
Thanks,
Matt
Instead of hard-coding my domain name, I simply changed line 29 to this:
I'd love to know if this is the result of a misconfiguration somewhere else, or if it's actually a bug as it seems to be.
Code: Select all
$data['base'] = $server . '/';
This solution worked for me as well!recseiuq wrote:Instead of hard-coding my domain name, I simply changed line 29 to this:
I'd love to know if this is the result of a misconfiguration somewhere else, or if it's actually a bug as it seems to be.Code: Select all
$data['base'] = $server . '/';
Thank you very much
Thanks derv.god!!
I was trying for days to solve the exact issue and this worked!
Although I used this solution provided by recseiuq and it still works fine.
I was trying for days to solve the exact issue and this worked!
Although I used this solution provided by recseiuq and it still works fine.
Code: Select all
$data['base'] = $server . '/';
I have the same problem as you do/did. His solution didn't help and I'm using Journal as well. Have you found a solution please?
Who is online
Users browsing this forum: No registered users and 45 guests