Redirect script (if mobile)?

by 14 replies
17
One of the threads mentioned a script that you can put in your pages that deciphers if its mobile and directs it to an appropriate page.

Does anyone know what it is or where I can get the code?

NO NO NO I don't use wordpress (and won't) so please don't show a wp plugin LOL.

Amber
#offline marketing #mobile #redirect #script
  • Why won't you use Wordpress? It is the easiest to use as well as very customer friendly.
    • [1] reply
    • Not for mobile, and not for what I need it for.

      Thanks - but you won't convince me.

      I use it on other sites - not ones like this, it just doesn't do what I need.

      Amber
      • [1] reply
  • Just use html which works just fine.

    Here is a script you can try.

    <script type="text/javascript">
    <!--
    if (screen.width <= 600) {
    document.location = "http://yourdomain.com/mobile/index.html";
    }
    //-->
    </script>

    Quentin
    • [1] reply
    • Quinten:

      Thank you!

      I have been fighting with an .htaccess script for 2 days now, and this one works like a charm.

      My only concern is (and why I was trying .htaccess) is that I understand the javascript doesn't work in all cases. is that correct?
  • Yes it varies on different servers.

    The absolute best way is simply add a link or a graphic link on the website to your mobile page.

    Quentin
  • .htaccess requires that you have 2 different domains otherwise you wind up in a loop. Sub-domains or directories won't work with it.
    • [1] reply
    • The easiest thing by far is to get WillR's WSO. Been looking for a redirect script and he has one of the best I've seen. It gives visitors the option to use desktop or mobile which in my opinion is the best way. I've tested all scenarios from httacess, php,java,user agents, etc and with his new updated one it will work for quit some time.

Next Topics on Trending Feed