3 Answers
3

Try host example.com and host www.example.com from your command line to see if the different requests are being routed to the same server.

If not, you'll need to update the DNS for your domain to be consistant

Is Apache getting confused? For any given request, Apache will use the first virtual host in its config which has a matching ServerName or ServerAlias. Check that you don't have conflicting vhost configuration

Sorry, lack of details from my part. They are supposed to be the same sites, but there seem to be two different apps (in ruby on rails speak) running. Their session IDs are different (or at least sessions aren't shared, logging in on one of them doesn't mean I'm logged in on the other one).
–
Emil AhlbäckJul 28 '11 at 14:29

Aaah, ok. Got it. In that case my answer is way off, and I don't know ;)
–
AlexJul 28 '11 at 14:35

@eml - Oh, from your description it sounded like your app was only responding to one of those domains. What you mean is, you are getting the same app from both domains but they aren't sharing the same session. That totally changes the question, and it might have been relevant on StackOverflow after all
–
GarethJul 28 '11 at 16:23

@Gareth, actually I don't know if they are in fact the same app. There are some differences at least: sessions aren't shared, and the favicon (not specified in html as browser find those themselves I've heard) are NOT shared. The favicon is shown on the www-version, not on he no-www-version.
–
Emil AhlbäckJul 29 '11 at 11:44