Post by rri » Tue Jul 05, 2016 4:05 pm

Hello,

Re website: http://www.regentroyalty.com

I am experiencing the following error when I attempt to access the Orders page in the Admin area:
2016-07-05 7:22:49 - PHP Notice: Undefined index: key in /home/rri/public_html/catalog/controller/api/login.php on line 11

I have the following code in the .htaccess file to redirect everything from http to https except for admin:
# For redirecting HTTP to HTTPS, comments are line by line
# below line checks for https flag
RewriteCond %{HTTPS} off
# below line excludes the mentioned URIs from redirection
RewriteCond %{REQUEST_URI} !^/(admin/)
# below line redirects all other URIs except the ones that are mentioned above
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

I have attached an image of the error I am receiving as well. If I remove the code from the .htaccess file there are no errors, however, I do wish to have the store redirect customers to the secure https version of the site by default.

Any advice or help would be greatly appreciated!

~rri

Attachments

Screen shot 2016-07-05 at 3.53.45 AM.png

Screen shot 2016-07-05 at 3.53.45 AM.png (79.73 KiB) Viewed 2296 times


~rri


rri
Newbie

Posts

Joined
Wed May 11, 2016 7:29 am


Post by straightlight » Tue Jul 05, 2016 7:09 pm


Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Thu Jul 07, 2016 2:39 am

This solution may resolved the issue: http://forum.opencart.com/viewtopic.php?f=2&t=164930 . Although, do not consider to use, yet, as an official stable release at this time.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rri » Thu Jul 07, 2016 1:48 pm

Hi,
I tried the steps with the two solutions you mentioned but unfortunately, they did not resolve the problem.

Thanks again.

~rri

~rri


rri
Newbie

Posts

Joined
Wed May 11, 2016 7:29 am


Post by rri » Thu Jul 07, 2016 1:54 pm

I have a question, if remove the redirection code from the .htaccess file the problem does not happen. If I removed the code, will the customer who went to an http link version of the site and adds to cart and goes to check out, be directed to the https link or the non secure one?

Thanks.

~rri


rri
Newbie

Posts

Joined
Wed May 11, 2016 7:29 am


Post by straightlight » Thu Jul 07, 2016 8:10 pm

rri wrote:I have a question, if remove the redirection code from the .htaccess file the problem does not happen. If I removed the code, will the customer who went to an http link version of the site and adds to cart and goes to check out, be directed to the https link or the non secure one?

Thanks.
By default, it does not due to possible SSL interaction issues which merchants won't be able to track from the back-end other than viewing the error logs, in this case.

However, if you are willing to take the risk but to protect your customer's sessions while the product is being added to the cart, you can edit your catalog/controller/checkout/cart.php file by

finding:

Code: Select all

$json['redirect'] = str_replace('&', '&', $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']));
replace with:

Code: Select all

$json['redirect'] = str_replace('&', '&', $this->url->link('product/product', 'product_id=' . $this->request->post['product_id'], true));
This should resolved the partial problem.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rri » Mon Jul 11, 2016 4:03 pm

Thank you so much for the info/advice! I am debating weather or not to not use constant SSL in the .htaccess file.
Does this error effect the customer purchasing on the site? When the error occurs in the orders section on the admin side, will an order still show up after the error?

Thanks again.

Best regards,

~rri

~rri


rri
Newbie

Posts

Joined
Wed May 11, 2016 7:29 am


Post by straightlight » Mon Jul 11, 2016 7:02 pm

Two solutions have been posted yesterday regarding this issue:

- http://forum.opencart.com/viewtopic.php?f=24&t=165085
- http://forum.opencart.com/viewtopic.php ... 83#p622978

See if both solutions resolves the issue, also during checkout.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rri » Sun Jul 17, 2016 3:13 pm

A developer I was working with inadvertently resolved the problem for me.

In /system/config/admin.php and catalog.php set:

Code: Select all

$_['site_ssl']          = true;
Best regards,

~rri


rri
Newbie

Posts

Joined
Wed May 11, 2016 7:29 am

Who is online

Users browsing this forum: No registered users and 3 guests