homepage Welcome to WebmasterWorld Guest from 174.129.76.87
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Mobile Internet / Mobile Web Site Design and Development
Forum Library, Charter, Moderators: not2easy

Mobile Web Site Design and Development Forum

    
Telling a mobile web browser where the desktop version of a site is?
misterm2008

5+ Year Member



 
Msg#: 4602402 posted 11:43 am on Aug 16, 2013 (gmt 0)

Hi

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.

Hope that makes sense?

Many thanks

Mr m

 

BeeDeeDubbleU

WebmasterWorld Senior Member beedeedubbleu us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4602402 posted 12:18 pm on Aug 16, 2013 (gmt 0)

Media Queries?
[google.co.uk...]

explorador

WebmasterWorld Senior Member 5+ Year Member



 
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 them on diff directories then include a link to the equivalent page on the other directory. It should be easier with a custom made CMS, otherwise if the pages have the same url base, you can include a simple javascript writing the right link from each page to the other one.

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Mobile Internet / Mobile Web Site Design and Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved