fecshop在反向代理服务器后端的时候手机检测不能正确跳转

bug问题 · hetao · 于 7年前 发布 · 2167 次阅读

yii2_fecshop/services/Store.php中redirectMobile函数

    $currentUrl = Yii::$service->url->getCurrentUrl();
    $redirectUrl = str_replace($store_code, $redirectDomain, $currentUrl);

$currentUrl得到的是内网地址,导致str_replace不能正确执行

共收到 6 条回复
hetao#17年前 0 个赞

个人觉得getCurrentUrl()中应该用$homeUrl拼接

hetao#27年前 0 个赞

actionGetCurrentBaseUrl()就是返回的$homeUrl

hetao#37年前 0 个赞

用$storeCode拼接可能更好

hetao#47年前 1 个赞

最后发现apache代理配置中加入 ProxyPreserveHost On 也可以解决

hetao#57年前 0 个赞

nginx是 proxy_set_header Host $http_host;

6楼 已删除.
Fecmall#77年前 0 个赞

用你的服务器设置来解决吧

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics