After changing into https and adding the following code to the .htaccess file:
RewriteCond %{HTTP_HOST} domainname\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.domainname.com/$1 [R,L]
I get a 'SytaxError:Unexpected end of JASON input error' when I want to edit an order.
When I revert to:
#RewriteCond %{HTTP_HOST} domainname\.com [NC]
#RewriteCond %{SERVER_PORT} 80
#RewriteRule ^(.*)$ https://www.domainname.com/$1 [R,L]
the error goes away and I can edit. But in this case, the website is not secure anymore and an unsafe sign appears at the top left side of the browser next to the address section.
I want to keep the site at https and still edit the orders. Can anyone help? Thank you...!
You do not post the most important thing: what OpenCart version you are using.
So what shall we do - take a look into a scry?
But I guess some lower than 2.3.x - correct?
So what shall we do - take a look into a scry?
But I guess some lower than 2.3.x - correct?
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
What I thought.
Use this here: Admin Order Edit HTTPS-Fix
Use this here: Admin Order Edit HTTPS-Fix
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
I don't know if it has anything to do with the reported error, but I do see a couple of problems in your code:
1) You are testing for a missing www. in the domain (host name) AND that http is being used (no SSL). You need to test these separately. The easiest way would be to add an OR flag on the first line: [NC,OR]. That will trigger the rewrite if it's missing www. OR it's http.
2) The R flag in the rewrite defaults to 302, which is a temporary move. You should be using [R=301,L] to signal a permanent move.
Check your configuration files that you are using www.domainname.com and https everywhere in them -- you shouldn't be relying on .htaccess to rewrite incorrect URLs. You should supply correct URLs in your configuration.
Is that JASON or JSON in the error message?
Code: Select all
RewriteCond {HTTP_HOST} domainname\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.domainname.com/$1 [R,L]
2) The R flag in the rewrite defaults to 302, which is a temporary move. You should be using [R=301,L] to signal a permanent move.
Check your configuration files that you are using www.domainname.com and https everywhere in them -- you shouldn't be relying on .htaccess to rewrite incorrect URLs. You should supply correct URLs in your configuration.
Is that JASON or JSON in the error message?
Who is online
Users browsing this forum: No registered users and 119 guests