所有 http 活动都集中到一个网站。 (htaccess?)
我想在我的笔记本电脑上设置一个临时网络(让笔记本电脑成为路由器)并让智能手机用户连接到它。
当他们连接并尝试浏览任何网页时,我希望他们访问我计算机上的本地主机。
是否可以在笔记本电脑上设置其他人可以连接的网络?
是否可以将所有 http 流量重定向到笔记本电脑的本地主机? (我正在考虑根目录上的 htaccess,但我对此没有经验)
I would like to setup a ad-hoc network on my laptop (letting the laptop be a router) and let smartphone users connect to it.
When they've connected and try to surf to any webpage, I would like them to go to the localhost on my computer.
Is this possible to setup a network on a laptop where other can connect to?
And is it possible to redirect all http traffic to the localhost of the laptop? (i was thinking about a htaccess on the root, but i'm not experienced with that)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您需要做的是在笔记本电脑上设置一个 DNS 服务器,它将所有 DNS 请求定向到您的
localhost
。您可能面临的问题是(据我所知)adhoc 网络不支持 DHCP。这意味着您无法自动告诉设备要使用哪个 DNS 服务器。根据您的网络适配器和操作系统,您也许可以将网络适配器设置为接入点模式。
i think what you need to do is setup a DNS-server on your laptop, which is directing all DNS requests to your
localhost
.the problem you might face is that (afaik) adhoc networks do not support DHCP. that means you cannot tell the devices automatically which DNS server to use. depending on your network adapter and OS you might be able to set the network adapter into access point mode.