I am using apache2 and I need to redirect https traffic to http for my captive portal application. For ex https://www.google.com to http://www.google.com. I place the captive portal as the gw. Can you help me with this?


You can't really intercept https on a captive portal anyway because you won't have the right certificates to prevent users from receiving browser warnings, but you don't have to do so anyway. You only need to redirect all HTTP traffic to your captive portal. All modern computer and mobile device operating systems try to request an HTTP URL as soon as they connect to Wi-Fi to detect the existence of a captive portal. If the HTTP request is redirected, they pop up a window with your captive portal web page.

  • Thank you Micheal. Im trying to fo this because i need to do it with macs on wired connections too and it seems like macs dont do the captive portal check on wired connections. Do you have any information on that? – user19215 Jul 10 '20 at 16:39
  • @user19215 I don't know about macOS doing captive portal checks on wired connections. Of course if this is a wired connection you might want to be doing 802.1x or something like that instead. – Michael Hampton Jul 10 '20 at 16:45
  • I am doing dot1x and clients that are not authenticated are assigned to the guest vlan. And cp is the gw there too. – user19215 Jul 10 '20 at 16:47
  • In the worst case, nothing will work until they open a browser, and then they'll finally be redirected. Hopefully. – Michael Hampton Jul 10 '20 at 16:52
  • Well when they try a website with a certificate hsts control comes in and – user19215 Jul 10 '20 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.