How to redirect local hotspot traffic to webserver
What you are talking about is called captive portal. On android this can be done by loading our own configuration file for dnsmasq. I made an a minimal UI app for this purpose. You can find it on XDA : https://forum.xda-developers.com/android/general/guide-setup-fake-captive-portal-android-t4011689
If you are android developer, please help us to improve the app.
And also this app requires root permission.