Javascript Redirect Domain Referrer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thonglife
    So Fucking Banned
    • Oct 2004
    • 1566

    #1

    Javascript Redirect Domain Referrer

    Anyone have the code to redirect, via javascript, a domain to another. I have this but it's not working for some reason..

    <script language="JavaScript">
    var b = 'someforum.com';
    if (document.referrer.indexOf(b)!=-1){
    location.href='http://www.somesite.com';
    }</script>

    Something's messed up. It used to work but I think I've omitted a string. TIA!!!
    Last edited by thonglife; 08-16-2005, 05:02 AM.
  • chris01282
    Confirmed User
    • Feb 2005
    • 370

    #2
    Don't know about javascript, but if you put this below into a webpage and call it index.html in the root of the site you want to transfer from, it will redirect all traffic to www.new_domain.com after 0 seconds.

    <html>
    <head>
    <title>Sex</title>
    <META HTTP-EQUIV="REFRESH" CONTENT="0; URL=http://www.new_domain.com">
    </head>
    <body>
    </body>
    </html>

    Hope that helps

    Comment

    • thonglife
      So Fucking Banned
      • Oct 2004
      • 1566

      #3
      Originally posted by chris01282
      Don't know about javascript, but if you put this below into a webpage and call it index.html in the root of the site you want to transfer from, it will redirect all traffic to www.new_domain.com after 0 seconds.

      <html>
      <head>
      <title>Sex</title>
      <META HTTP-EQUIV="REFRESH" CONTENT="0; URL=http://www.new_domain.com">
      </head>
      <body>
      </body>
      </html>

      Hope that helps
      I'll try and tweak that some.. thanks!

      Comment

      • thonglife
        So Fucking Banned
        • Oct 2004
        • 1566

        #4
        Originally posted by chris01282
        Don't know about javascript, but if you put this below into a webpage and call it index.html in the root of the site you want to transfer from, it will redirect all traffic to www.new_domain.com after 0 seconds.

        <html>
        <head>
        <title>Sex</title>
        <META HTTP-EQUIV="REFRESH" CONTENT="0; URL=http://www.new_domain.com">
        </head>
        <body>
        </body>
        </html>

        Hope that helps
        Actually.. I found this on an old page of mine I wanted to stop another site from linking:... workslike a champ. Thanks for your input though...

        <script language="JavaScript">
        var b = 'offendersurl.com';
        if (document.referrer.indexOf(b)!=-1){
        location.href='http://www.siteyouwantredirectedto.com';
        }</script>

        Comment

        Working...