Safari won't open mail link with wifi on
I have iphone 7 using iOS 10.3.1. When I have a weblink in an email and I click it, safari will not open when I'm connected to wifi. If I click a link it pops up "Safari cannot open the page because the server cannot be found. If I turn wifi off and use data it will load. Then I can turn wifi back on and it works fine with wifi. It only happens when I try to open a link from mail. I keep having to turn wife off and back on. This is not just at my home. Its anywhere that I am connected. Its been happening since iOS 10 and maybe before. Any idea how to fix this?
iPhone 7, iOS 10.3.1