How to redirect a mobile user

Continuing the discussion from Redirecting an existing Desktop Site to the Webflow Smartphone view:

For everyone that’s also wondering about, this is a very hacky, but working way. Add this ONLY to your homepage, in the head.

<script type="text/javascript">
  <!--
  if (screen.width <= 520) {
    window.location = "/url-here";
  }
  //-->
</script>

Note: you could also use “http://www.domain.com” as a url, but to stay dynamic, the forwardslash+pagename works better [and directly in the WF editor.

Ok, something to note:

If you are going to export the website, make sure you let the url end with .html. Otherwise it will end up dead (as webflow doesn’t create a .htaccess upon export).

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.