Msg#: 4602402 posted 11:43 am on Aug 16, 2013 (gmt 0)
I have a few websites that I have developed mobile versions of the same website for. I have setup a simple PHP mobile detector, that redirects visitors from the desktop version of each site to the mobile version of each site. All works well, redirecting from Desktop to mobile.
My question is, how can I tell mobile web browsers where the desktop version of a site is?
For example, when I view one of my mobile sites within the Google Chrome browser on my Android phone, there is a menu option "Request Desktop Site". When I select this menu option for sites that are in a sub-directory of the main site, such as www.mysite.com/mobile, it easily forwards the user to the desktop version of the site.
However, if I try "Request Desktop Site" for a mobile site that is on a subdomain, such as [m.mysite.com,...] Chrome can't seem to find the desktop version of the site.
Msg#: 4602402 posted 5:27 pm on Aug 24, 2013 (gmt 0)
There are diff ways depending on how you got your mobile and desktop version.
If you have the same content being served over the same URL detecting the device on the server then use a cookie, it should show and keep the right version for the user.
The feature you talk about "request desktop site" is mainly modding the user agent to tell the server "I'm a mobile device" or "I'm a desktop", this will work if you show your visitors the same url but you choose what to server on the server side based on the user agent.
The trick: it's not 100% guaranteed but mobile devices include the word "mobile" on their user agent string, desktop versions won't have that. I say it's not 100% safe because android is to fragmented you can find cellphone software modifications installed on tablets without that working as it should.