My understanding is that the metadata, added automatically by the phone or camera (i.e. properties like the date) attached to the picture file tells the photo or web application which way up it should be; based on which way the camera took the picture (they know where they are, you see!).
Knowing this, I have found that the way all sorts of programs and apps detect the orientation is variable and even though you think you might have rotated it (say in a phone app) it doesn't always override the inherent picture properties.
I agree with Duane, re-orientating and saving via a reputable photo program / app is the best way to ensure you get what you intend in the upload to the website. Most photo apps allow you to erase the properties but if they remain on their side i.e. in the original orientation, this won't solve the problem.
Trial and error is my best guide.
John