Search code examples
.htaccessnetwork-programminghttp-redirectwifismartphone

all http-activity to one website. (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)


Solution

  • 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.