我有多个本地站点,我在本地计算机上开发。
我希望能够在移动设备上访问它们,因为它们仍在我的机器上本地。
使用XAMPP
这些是示例vhosts
配置:
<VirtualHost *:8080>
DocumentRoot "C:/design and photos/agency1/website/public_html"
ServerName agency1dev.com
<Directory "C:/design and photos/agency1/website/public_html">
Options All
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot "C:/design and photos/captives/website/public_html"
ServerName capdev.com
<Directory "C:/design and photos/captives/website/public_html">
Options All
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Windows主机文件
127.0.0.1 agency1dev.com
127.0.0.1 capdev.com
我知道我可以使用我的机器IP地址达到例如:
http://196.168.2.3:8080
但这是XAMPP
目录,所以,我如何访问,例如agency1dev.com
?
这可能吗?
答案 0 :(得分:1)
答案 1 :(得分:0)
我找到的解决方案是使用NGROK
非常容易实施:
In cmd or some shell
Go to: C:\path\to\ngrok
Type:
ngrok http -host-header=myapp.dev 8080
Change myapp.dev to suit what you want to look at - and change port (8080) accordingly
Then look at output and it will give you a http and https url to navigate to on your device
Simple!