So I need to set up mobile redirect for a Drupal 7 site I've been working on, but there are some conditions and I can't quite decide what the best route would be. Basically, if the user is browsing the site on mobile, we need to redirect to m.example.com - However, we also want this to NOT happen if the user is browsing within the "Events" section of our site "example.com/events," but there is also a link ON the mobile site to view the full page and redirects to "example.com/?nomobile=true" and if the user follows this link we want to break the redirect
Given these conditions, does anyone know the best course of action? Whether it's a module that can be configured (Simple Mobile Redirect doesn't seem to be flexible enough to handle all of this), or some kind of PHP code - I tried doing this with JavaScript but the redirect just doesn't seem to fire (even though the console.logs within the function are returned, so I don't think that will work.)
Much appreciated