I have a wordpress site set up on Amazon EC2, and I’m having trouble getting the mobile theme switcher to work properly. I have the site set up on multiple instances, behind a load balancer, at http://www.domain.com (just an example). I also have an apache directive that causes the browser to be redirected to http://www.domain.com/* when going to domain.com/* (this is the way I had to set it up – domain.com points to a single instance, while http://www.domain.com points to the load balancer, which has that instance plus 1 or more instances behind it).
Now, most of the time I try to visit the site from a mobile device, to http://www.domain.com, it serves the desktop version. However, when I temporarily comment out the apache directive so that I can visit domain.com instead, it loads the mobile version just fine, every time. Occasionally it does load the mobile version from http://www.domain.com, but it is very sporadic and rare.
I thought it might have something to do with the auto-launched extra instances behind the load balancer, but even after terminating those, it still behaves the same way.
I also checked the mysql options table and it does indeed define the site as being http://www.domain.com/. Any ideas?
I realize the load balancer thing sounds kind of weird, but I’m pretty sure I ruled that out as being the culprit.