abou desktop redirection from mobile(switch to desktop view)

Avatar
  • Answered
I'm using this code to direct the users from desktop version to my mobile site. http://mywebsite.com/mobile'); ?> i would like to give the users the option to switch back to desktop version from the mobile website but this code will redirect them back to mobile site. I was wondering if i can create an if statement to force the browser to stay on that page. for example if i can link back from mobile website using www.mywebsite.com?device=desktop and modify the code to recognize the url. my knowledge of PHP is limited so any help would be greatly appreciated.
Avatar
Arn
Hello, Thanks for the question and sorry for the problem with the mobile-site redirect. It is now preferred that you build websites as responsive so there is no distinction between a mobile and non-mobile website - it would all be one site. However, you may want to refer to our Mobile Re-direct article. We can't really provide direct coding assistance, other than to point to other possible solutions. There are several comments where code is provided that checks to re-direct to a mobile page, but if one of the conditions ('m') is set to FALSE, then it would re-direct to the full-size site. You would need to change the code so that you provide a way for the user to re-direct to the mobile site regardless of the current conditions. If you are unable to change the code yourself, then you will need to consult with a developer for further assistance. I hope this helps to answer your question, please let us know if you require any further assistance. Regards, Arnel C.