Hi and welcome to Apple Discussions...
From your Safari menu bar click Safari / Preferences then select the Security tab. Click: Show Cookies. Delete all cookies or delete the cookies associated the sites you have problems accessing.
And, open a Finder window. Select your Home folder in the Sidebar on the left. Now open the Library folder then the Caches folder then the com.apple.Safari folder. Move the cache.db file from the com.apple.Safari folder to the Trash.
had same problem. I found it in my case. think about your wifi, linksys by chance? Iphone, laptop, Ipad maybe another wifi etc?? how many conncections have you grown to? Try shutting off a few of yoru wifi devices. router can't handle them all. Will work fine. shut those off and then turn the other ones back on. they work fine?? You need a bigger router. good luck.
All of the above solutions work just fine because when you do anyting that reauthenticates your wifi device, it goes to the front of the line. But if I am correct, it will quit working the minute another device is authenticated after it. the new authentication will work just fine and the one that WAS WORKING now won't work... your router wifi slots are all full.