We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!

Answered Need WAP site

    • 46886
    • 1,154 Posts
    For reasons I don't want to get into, I need a WAP site. I know already how to use media queries so that I can have one integrated css file to serve all versions of the site, and I see there are some switchers to choose which css file to serve in other cases.

    But I am not sure what will let me keep the mobile site on wap. Is there a switcher which will send the mobile users to the wap site? This is what I need, a way to direct mobile users to the wap site.

    If someone could clue me in I would be very appreciative.

    Thanks in advance!

    This question has been answered by paulp. See the first response.

    • discuss.answer
      • 22840
      • 1,572 Posts
      You can use simple javascript for that like below, just change the http://www.mobilesite.com to the address you want to send them to and add it into the header for the desktop site

      <script type="text/javascript">
      <!--
      if (screen.width <= 720) {
      document.location = "http://www.mobilesite.com";
      }
      //-->
      </script>


      You'll also want to redirect all none mobile traffic to the desktop so add the following to the header of the wap site:

      <script type="text/javascript">
      <!--
      if (screen.width >= 721) {
      document.location = "http://www.mobilesite.com";
      }
      //-->
      </script>
        • 46886
        • 1,154 Posts
        Thank you Paul! I was wondering how to do it.

        I really appreciate this, and now will go on to figure out how to add in this subdomain.