13 replies
Hi,

I just created a site with wordpress and wanted to see if anyone here can recommend a plugin that PREVENTS mobile devices from viewing my page.

No IPADS, No Phones, No Android.

I did a calculator on the site that once they reach the page, I want them to only be able to view it on a laptop or desktop.

They can view the whole site on their mobile devices but just this one page, I want them to only be able to see it on laptop or desktop.

Basically detect somehow and show them a message to use a desktop.

Any help is appreciated.

Mr. Fork
#devices #mobile #wordpress
  • Profile picture of the author Izesta
    That need is very unique. Never heard that before.

    Seems you might lose some visitors by not letting them view a page on their device that you have linked to. What's the harm in them seeing it and just have a message that says the page is best viewed on a desktop, etc.?
    {{ DiscussionBoard.errors[4318931].message }}
  • Profile picture of the author Michael Lewis
    Its really not possible to stop someone from visiting your website on a mobile device. Most smartphones will detect that there is no mobile site for your page and optimize it for that device. With my android phone I could go to any desktop website, the browser would register as a firefox browser.
    {{ DiscussionBoard.errors[4318945].message }}
  • Profile picture of the author Jay Moreno
    why not just use the usual mobile detect and redirect scripts and redirect them to a page with your message on it - no point reinventing the wheel...

    few options here...

    http://www.warriorforum.com/offline-...bile-site.html
    Signature
    Sorry, I am too busy helping people to think of a cool signature!
    {{ DiscussionBoard.errors[4319210].message }}
  • Profile picture of the author susanexpress
    where is your web. I want to know if I can visit it. and in this I can provide you some good idea
    {{ DiscussionBoard.errors[4319289].message }}
    • Profile picture of the author Howard88
      Wow, that is an unusual request. But I'm glad you asked it because I've wanted to ask a similar question.

      But first, I think Jay Moreno's idea about the redirect script will work for you.

      You may want to set up another page that the script directs them to in order to tell them "Sorry, but you mobile folks need to sit down before you hear what we have to say, so get your ass home so we can tell you this important shtuff because it's gonna blow your mind... we don't want to be responsible for you wrecking your car when you hear this." Or something like that, just to give them a bit of a nudge to check out your desktop site again later.

      I'm being facetious here obviously. I'm sure you have a very good reason and I'm extremely curious about it. So let us know and maybe some of the warrior coder types can help out.

      My addendum to the question would be this... (And please, if anyone can answer this I'd be so appreciative)

      If I have someone on a mobile device go to the site I've installed the redirect script on, is there a way that I can send that person back to the original non-mobile site without the person being redirected again to the mobile site again? The reason I ask is that some clients might want their actual full websites to still be accessible to mobile users if they wanted it.
      {{ DiscussionBoard.errors[4320623].message }}
      • Profile picture of the author Brandon Tanner
        Originally Posted by Howard88 View Post

        If I have someone on a mobile device go to the site I've installed the redirect script on, is there a way that I can send that person back to the original non-mobile site without the person being redirected again to the mobile site again? The reason I ask is that some clients might want their actual full websites to still be accessible to mobile users if they wanted it.
        I was just about to say you could use cookies for this, but Jay beat me to it. To get around the problem of some devices not accepting cookies, you could use php "sessions" instead (works in a similar way to cookies, except the info is stored on the server).

        Only drawback to using sessions is that the stored info is temporary and will be deleted after the user has left the website.

        That said, the simplest solution to this problem is to just have the script on the main site simply ASK any mobile-detected users if they want to go to the mobile-optimized site (via a hyperlink at the top of the page), instead of automatically re-directing them.
        Signature

        {{ DiscussionBoard.errors[4321984].message }}
  • Profile picture of the author Jay Moreno
    @Howard

    You could use cookies and a conditional statement to remember the users preference and determine if the redirect script runs or not - however some non smartphones and in particular the older type may have problems with handling cookies

    Hope that helps

    Jay
    Signature
    Sorry, I am too busy helping people to think of a cool signature!
    {{ DiscussionBoard.errors[4321822].message }}
  • Profile picture of the author Jay Moreno
    yeah as Brandon said php sessions work pretty much the same way too - just you would need to make sure your files all have a .php extension
    Signature
    Sorry, I am too busy helping people to think of a cool signature!
    {{ DiscussionBoard.errors[4322334].message }}
  • Profile picture of the author Howard88
    Thanks guys!

    I like the sessions idea because it sounds like each time it does the same thing and I wouldn't want a cookie warning thing coming up on the person's mobile.

    I'd probably just do a straight redirect to the mobile, then have a link button back to the main non-mobile site with something in that link that says stay on the main site.

    I'm guessing that's possible with this php sessions thingy.
    {{ DiscussionBoard.errors[4324516].message }}
  • Profile picture of the author LooseChange
    The solution has nothing to do with cookies.

    All you need to do is detect the "user-agent" http client variable and route visitors in the way you see fit.

    Check : html - Auto detect mobile browser (via user-agent?) - Stack Overflow
    Signature
    I'm not promoting anything
    {{ DiscussionBoard.errors[4324552].message }}
  • Profile picture of the author Jay Moreno
    @loosechange... Please read the full thread the cookie response was a reply to a secondary question... You would get stuck in a loop if you used just a user agent alone to return the user to the front main site if the front page had a mobile redirect on using your method alone which was what the secondary question and answer about cookies was referring too...

    Detecting the user agent would work for the OPs solution but would kinda be overkill since it's only needed on a single page
    Signature
    Sorry, I am too busy helping people to think of a cool signature!
    {{ DiscussionBoard.errors[4325066].message }}
    • Profile picture of the author Restaurant Fork
      For some reason, all the emails went to my spam folder.

      Thanks for all the help here. I'm still stuck though.

      The only solution, I figured out was using a wordpress plugin called REDIRECTIONS.

      It only detects Iphone for me. Not the other mobile devices

      My site is restaurantfork.com. Everyone should be able to see the whole site EXCEPT for the Ugly calculator. This is the single page I want no one on mobile devices to see. It's an intensive calculator. Basically 99% of the people visiting my site is because of it.

      So still looking for a working solution.
      {{ DiscussionBoard.errors[4357922].message }}
      • Profile picture of the author maxmalini
        You can probably use javascript or php code to read the browser user agent string and then redirect accordingly whether it's a mobile device or a desktop.

        - Max
        {{ DiscussionBoard.errors[4358981].message }}

Trending Topics