Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help with mobile redirect & :view desktop site

    I am making a site HERE and I was using this:

    Code:
    <script>
                if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile/i.test(navigator.userAgent)) {
                    if (document.URL != "http://www.precisionpaintandcollision.net") {
                        window.location = "http://m.precisionpaintandcollision.net";
                    }
                }
    </script>
    to auto-redirect mobile users to the mobile site and I want to keep that but I want them to be able to view the desktop site without that code affecting them. I know some apps have "force/request desktop site" but i'd like them to be able to just view the desktop site without auto redirecting to mobile site. Is this possible? Thanks -John

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,786
    Thanks
    6
    Thanked 1,022 Times in 995 Posts
    You would have to set a cookie and only redirect if that cookie isn’t set, I suppose.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •