Support » Plugin: Redirection » user agent

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author John Godley

    (@johnny5)

    How doesn’t it work? Does the user agent exactly match Mozilla/5.0?

    Hey, thanks for this quick reply!
    Okay, you’re right. It works if I put in e.g. exactly my user agent:

    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.145 Safari/537.36 Viv/2.6.1566.49

    But for the function to make sense, I would have to be able to make the query more general – e.g. all FireFox or all IE or what ever. Is this possible?

    Or: can I paste in more than one user agent to this line?

    Plugin Author John Godley

    (@johnny5)

    That’s what the regex option is for. More details can be found here:

    https://redirection.me/support/matching-redirects/

    No you can’t paste multiple lines.

    Okay, I tried to find a solution with “regex” for more than 2 hours now. I couldn’t figure it out. I did it with javascript now.

    For all who are interested in:

    <script type="text/javascript">
    if(navigator.appName.indexOf("Internet Explorer")!=-1 || navigator.userAgent.match(/Trident.*rv[ :]*11\./))
    {
       //This user uses Internet Explorer
       window.location = "/newsite.html";
    }
    </script>
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.