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

bug问题 · hetao · 于 5年前 发布 · 1703 次阅读

yii2_fecshop/services/Store.php中redirectMobile函数

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

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

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

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

hetao#25年前 0 个赞

actionGetCurrentBaseUrl()就是返回的$homeUrl

hetao#35年前 0 个赞

用$storeCode拼接可能更好

hetao#45年前 1 个赞

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

hetao#55年前 0 个赞

nginx是 proxy_set_header Host $http_host;

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

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

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