1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How can I redirect based on browser?

Discussion in 'General Scripting Chat' started by lauraalles, Dec 6, 2016.

  1. lauraalles

    lauraalles Regular Member

    Joined:
    May 10, 2015
    Messages:
    201
    Likes Received:
    19
    Title.

    If Firefox, go to domain.com/ff.htm

    If Chrome, go to domain.com/cc.htm

    If everything else, go to domain.com/blah.htm

    I'm not good with scripts... Anyone have any idea? Thanks in advance!
     
  2. tasburrfoot

    tasburrfoot Regular Member

    Joined:
    Dec 16, 2008
    Messages:
    327
    Likes Received:
    152
    Google turns up atleast 20 examples in JS and another 20+ using PHP.

    Pull user agent, determine browser based on UA, redirect based on browser