In need of a javascript that redirects according to refferer

Discussion in 'HTML & Website Design' started by Rodder7, Jan 7, 2009.

  1. #1
    I use java, but am a newb twerp when writing the stuff.

    I had the script, but deleted it over the years. I think it was in a .shtml page. If the page can redirect without the target page showing a 302 redirect or something, that would be really great.

    Thanks for any help,
     
    Rodder7, Jan 7, 2009 IP
  2. maneetpuri

    maneetpuri Active Member

    Messages:
    152
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Hi,

    I can help you with such a script, but before I do that I need to know in which language you need this ASP or PHP. If any of these two then I can help as I know only these languages…. J

    Cheers,

    ~Maneet
     
    maneetpuri, Jan 8, 2009 IP
  3. Jaguarjace

    Jaguarjace Guest

    Messages:
    52
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I like using the meta tag that can redirect to another page and lets you go back a page ;)
    <meta http-equiv="Refresh" content="0;URL=http://www.yourdomain.com/">
    Code (markup):
    heres one type of javascript code I usally use for my website:
    
    <script type="text/javascript">
    <!--
    function Redirect()
    {
        window.location="http://www.yourdomain.com";
    }
    
    setTimeout('Redirect()', 100);
    //-->
    </script>
    
    Code (markup):
     
    Jaguarjace, Jan 8, 2009 IP
  4. Rodder7

    Rodder7 Active Member

    Messages:
    451
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    88
    #4
    Thanks for your replies. Good stuff.

    Good ideas for redirect, but what I am look for is when the referrer is hxxp://123.com, it will redirect to hxxp://abc.com and if the referrer is hxxp://456.com it will redirect to hxxp://def.com and if no referrer, no redirect will happen. I need this in javascript for a html page.
     
    Rodder7, Jan 8, 2009 IP