Auto reconnecting between Ethernet shield and esp8266

Side note: As long as you have two identical shields that you can active/deactivate via Reset (like the ESP8266) or via Chip Select (CS) (like the Ethernet cards) you can use more than one - whereas with the ESP8266 it does not really make sense.

For the Ethernet shield the only thing you have to do is move the Chip Select (CS) of the second one from Pin 10 (standard) to e.g. Pin 9.

The rest is connetion handling and activation/deactivation of the right interface.