Please help me

good afternoon!! please help me regarding my connection with apache webserver… everytime i have internet connection, then if i load my web project using localhost, it hangs and cannot load it but if dont have internet connection, my web project loads… what isthe cause of that problem and possible solutions? thanks!!