通过 wlan 从 android 设备访问本地主机

accessing localhost from android device over wlan

我正在 magento 的网站上工作,我正试图在我的 android phone 上访问我的网站。我已经完成了所有的事情,比如激活端口 80,允许 httpd.conf
下的所有设备 然后我在我的笔记本电脑上创建了 wlan 并将我的 phone 连接到它,我在网络浏览器上输入了我的 ip,它打开了 xampp 服务器的仪表板,但我只能访问 htdocs 的仪表板文件夹,我的项目在 magento 文件夹中。
当我尝试访问类似 putiing ip 192.168.173.1:80/magento 时,它将我的页面重定向到 127.0.0.1/magento 并且 msg 显示 web页面不可用

看来您的 magento 安装已挂接到 127.0.0.1 基础 url。当您想在 phone 上或临时测试您的网站时,您必须更改此设置。

你可以把你base_url换成新的192.168.173.1:80。因为那是 url 你想通过它访问它。尝试使用和不使用端口号 :80 以防出错。

你可以看看这篇文章https://www.siteground.com/kb/how_to_configure_magento_to_work_with_a_new_domain/ or this https://docs.nexcess.net/article/how-to-change-magento-base-urls.html

祝一切顺利