Redirection script if old version of Android and/or Os


(Martin C.) #1

Hi there,
would you have a clue of a script to redirect my site to another page if its detect versions before OS 10 and Android 7 ?
Thank you !!
Have a nice week-end
Martin


(Jonathan Deutsch) #2

The basic steps in javascript are:

  1. Parse the navigator.userAgent string to determine the browser/version
  2. Set the document.location.href to your new URL

I recently had to write some browser check and redirect code; you can see the source at http://tumult.com/store/check-and-redirect/ (you’ll either need to disable javascript or download it directly, otherwise you’ll be redirected!). You won’t be able to use it as-is because it is a bit specific case and doesn’t have the capability to check on those specific versions.

You’ll probably be able to find tips for those specific versions or sample code around the internet elsewhere.


(Martin C.) #3

Thank you Jonathan, I’m going to study it carefully !


(Hans-Gerd Claßen) #4

http://zeno.github.io/mobile-detect-demo/

… may be of some help too :slight_smile:


(Martin C.) #5

Thank you ! You’re an amazing team, I never feel alone when using Hype :). Have a great week.