For complementing @AWippler message. I implemented a captive portal in FreeBSD, and have perfomed some tests with Windows, Mac, iOS and Android devices as clients.
Be aware that according to my tests, newer Android versions when having Chrome installed, do the captive portal detection test(s) using port 443 instead of port 80. If you only intercept port 80 for the authentication, you will start scratching your head thinking why newer Android clients are not working.
(OK, just noticed this was bumped to the front page and the answer is from 2016...Android might have started doing that shortly after)
Besides intercepting port 80, you also need to setup a SSL host, intercepting port 443 and live with the SSL certificate error. Or use an actual DNS domain valid on the Internet at large with a valid certificate.
For visitors trying also to piece together how to implement Captive Authentication see also my Q&A Implementing a Captive portal using Apache and the related questions Getting WISPr tags from a FON authentication portal and; also useful for testing Disabling CNA in MacOS