dpda53918 2018-12-06 17:49
浏览 75
已采纳

在子域上访问Magento Admin

I have a running store on Magento 2 which has multiple websites that I can access in the front end without any problems, for example:

https://siteone.mymagestore.com
https://sitetwo.mymagestore.com
https://sitethree.mymagestore.com
.
.
.

But when I try to access the admin panel in the same way it redirects me to the main store URL, for example:

https://siteone.mymagestore.com/admin -> Redirects to https://www.mymagestore.com/admin

How can I allow accessing the Magento admin panel on URLs like https://siteone.mymagestore.com/admin as well?

I have tried many aspects to solve the problem but nothing seems to help. Any help on it would be highly appreciated.

  • 写回答

2条回答 默认 最新

  • duanjue2576 2018-12-18 10:50
    关注

    This can be done by changing adding the following code in Magento\Framework\Url

    getUrl() function - At the end add

    Replace:

    $this->cacheUrl[$cacheKey];
    

    With:

    $finalUrlArray = explode('://', $this->cacheUrl[$cacheKey]);
    $finalUrl = $finalUrlArray[0].'siteone.'.$finalUrlArray[1];
    return $finalUrl;
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动