前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >解决opencart设置SSL后评论不能翻页的问题

解决opencart设置SSL后评论不能翻页的问题

作者头像
ytkah
发布2019-05-25 18:39:50
1K0
发布2019-05-25 18:39:50
举报
文章被收录于专栏:ytkah

  为了网站的安全和seo,我们为客户的opencart网站添加了SSL加密实现https,并设置了301跳转使http跳到https,基本所有的功能都完好,就是有一点评论分页无法加载分页,去分析了链接源代码,发现分页链接是http开头的,http://www.cool.com/index.php?route=product/product/review&product_id=64&page=2,只要把这个http改为https就没有问题,知道原因就好解决了,我们找到评论控制器文件/catalog/controller/product/product.php,大概556行左右

代码语言:javascript
复制
$pagination->url = $this->url->link('product/product/review', 'product_id=' . $this->request->get['product_id'] . '&page={page}');

  怎么改呢?ytkah在Stack Overflow上找了一圈,有个提示

代码语言:javascript
复制
That's because the helper is designed to output URLs intended for use in HTML, where the & will be correctly parsed. Echo out your generated link and view the page source, or look at your shop links and you'll see what I mean.

If you dig deeper and look at the top of the account/account controller, you'll see this:

$this->redirect($this->url->link('account/login', '', 'SSL'));

  这个不就是ssl吗?我们试着改造一下

代码语言:javascript
复制
$pagination->url = $this->url->link('product/product/review', 'product_id=' . $this->request->get['product_id'] . '&page={page}', 'SSL');
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019-05-07 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档