There is a new feature in iPhone OS 3.0 for connecting to captive wireless portals.
When connecting to an open wireless network from within the Wi-Fi Settings, the iPhone will open a very thin browser and request http://www.apple.com/ with a UA string of "CaptiveNetworkSupport/1.0 wispr".
This was causing a problem on our wireless network here, where i've used some DNS trickery to present a web page containing connection instructions and a configuration profile for our WPA2 WLAN.
To get in just before the general release of OS 3.0, i've found a fix to stop the "login" sheet from appearing when connecting to the open WLAN.
I've inserted the following code into the top of the index page to return a 400 response to the CaptiveNetworkSupport UA.
Code:
<?php
if (preg_match ("/CaptiveNetworkSupport/", $_SERVER["HTTP_USER_AGENT"])) {
header ("HTTP/1.0 400 Bad Request");
exit ();
}
?>
We've tested this on the 3.0 GM and it's working fine.