Reputation: 91
I have already installed ssl certificate on my opencart site but some pages are working fine with https but category pages not working with https. Do I need to change all url in database also? In the config file, I already set https.
Upvotes: 2
Views: 3449
Reputation: 22959
Some of these may not apply to your particular installation but in the interest of creating a comprehensive answer, I've tried to cover all the bases here:
Note: you might need to adjust the table names depending on your store's table prefix if they don't begin with oc_
config.php
and admin/config.php
and change all those constant url declarations to https - make sure to include HTTP_SERVER
and HTTP_CATALOG
system > settings
, click edit
and in the server
table set Use SSL:
to Yes
.store_url
column in the oc_order
table so that all links are https. This is important because updating orders can fail if the api attempts to access http version of your site. you can use this query: UPDATE oc_order SET store_url = REPLACE(store_url, 'http:', 'https:')
oc_product_description
, oc_category_description
, and any other tables where you might have created html content.http://
links and images in footer.tpl
and header.tpl
for starters. You can simply browser your site to see if any of the pages are not showing the green lock icon in the browser and take it from there.oc_modification
table..httaccess
to gracefully let traffic know that your pages can now be found on https. I've excluded robots.txt
and any connections for the openbay routes because, based on experience, when I tried to redirect ebay webhooks it broke things and they seem to be http
only by default. I suspect this may be a shortcoming in how openbay handles those requests, or possibly a configuration issue but I was unable to find a workaround that didn't break openbay so for now I'd recommend leaving those requests untouched. I am using this in .htaccess
:RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !/robots\.txt$
RewriteCond %{QUERY_STRING} !^route=ebay/openbay/*
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
That should do it!
Upvotes: 6