Safari cannot open page because iPhone is not connected to Internet
You need to turn off WiFi before you leave the coverage area (or more precisely - before you reach the point where WiFi is still "connected" but not viable.)

In iOS 9 there will be a system setting to allow cellular data to take over sooner, but on iOS 8 and less, your device will throw errors when WiFi fails you and before the radio disconnects from WiFi.

Manually disconnect or control your location so that you don't try to use the internet when WiFi isn't viable.