I currently have a Raspberry Pi 3 equipped with a SenseHat running Raspbian. I Have made a website to control the SenseHat by running programs that use the SenseHat. My server is nothing fancy:). I needed a way to demonstrate my Raspberry Pi SenseHat website so I have my RPi configured as a wireless access point. I feel the next part is to make a captive portal so that I don't have to tell people to punch a long IP address into their phones when they want to control the SenseHat. Their are tutorials to do this but it doesn't seem to work captive portal to 172.24.1.1:1234. Their are tutorials to show me how to do this with lighttpd, I could do this but then I would have a Splash page with a link to my SenseHat Library Homepage and from that page their would be a link to the actual page you can run the SenseHat from(Seems a long ways around when you could go straight to the SenseHat Library HomePage!). I am sure their is a way to do this can anyone help?
I recommend doing this with a small set of iptables rules redirecting all traffic to port 80 and 443 to your home page.
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination localhost:80 iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination localhost:80
An example with the ip's that you have provided being:
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 172.24.1.1:24 iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 172.24.1.1:24
Additionally you should have your HTTP server configured to redirect every unknown URL to its start page. So that if a user enters
http://www.awesomepeople.com/Mohammad-Ali you don't get a 404 from your sense hat web server. This would in essence redirect them to
What the IP tables rules above are doing in essence is redirecting all traffic to your web server which in this case is your sense hat page, so if I where connected to your network and entered in any domain at all, i would be redirected to your page.