I have had this happen to me before. I go to a website, but Safari says I am not connected to the Internet. I check my system and my Wi-Fi says I am connected. I know this occurs to other people as well. If this has happened to you or just for future reference, you should read this article which contains a whole troubleshooting pathway to determine if the problem is with your Mac or your entire network. It supplies things you can do to fix this issue.