Javascript Redirect

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jonathan

    #1

    Javascript Redirect

    Hi,

    I want to ask something. Say I have a homepage oldhomepage.com

    Then I have a new homepage called newhomepage.com

    Now, I set up a redirection in oldhomepage.com

    this.location = http://newhomepage.com

    Say I want to check which homepages send traffic to


    Because http://newhomepage.com gets traffic from redirection, than the
    referrers in my stats will point at nothing or occasionally


    Say yahoo.com send traffic to http://oldhomepage.com how should I set
    the redirect so that the server at http://newhomepage.com will know
    where the real source is?

    Should I put

    this.location = http://newhomepage.com?referrer=document.referrer

    Will that do?
  • jonathan

    #2
    Re: Javascript Redirect

    Thomas 'PointedEars' Lahn <PointedEars@we b.de> wrote in message news:<30369825. cboY06pLdG@Poin tedEars.de>...[color=blue]
    > jonathan wrote:
    >[color=green]
    > > Now, I set up a redirection in oldhomepage.com
    > >
    > > this.location = http://newhomepage.com[/color]
    > ^ ^
    > Won't work. The new value must be quoted.
    >[color=green]
    > > Say I want to check which homepages send traffic to
    > > http://newhomepage.com
    > >
    > > Because http://newhomepage.com gets traffic from redirection, than the
    > > referrers in my stats will point at nothing or occasionally
    > > http://oldhomepage.com[/color]
    >
    > Yes, indeed.
    >[color=green]
    > > Say yahoo.com send traffic to http://oldhomepage.com how should I set
    > > the redirect so that the server at http://newhomepage.com will know
    > > where the real source is?[/color]
    >
    > You could pass the referring URL as query part component.
    > You could also use URL rewrite (Apache: mod_rewrite).
    >[color=green]
    > > Should I put
    > >
    > > this.location = http://newhomepage.com?referrer=document.referrer[/color]
    >
    > No.
    >[color=green]
    > > Will that do?[/color][/color]
    So, how should Ido it then?[color=blue]
    >
    > No, and redirection with client-side scripting is evil[tm].
    >
    > <http://www.w3.org/QA/Tips/reback>
    >
    >
    > PointedEars[/color]

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: Javascript Redirect

      jonathan wrote:
      [color=blue]
      > Thomas 'PointedEars' Lahn [...] wrote [...]:[color=green]
      >> jonathan wrote:[color=darkred]
      >> > Should I put
      >> >
      >> > this.location = http://newhomepage.com?referrer=document.referrer[/color]
      >>
      >> No.
      >>[color=darkred]
      >> > Will that do?[/color][/color]
      > So, how should Ido it then?[/color]

      Like this:
      [color=blue][color=green]
      >> No, and redirection with client-side scripting is evil[tm].
      >>
      >> <http://www.w3.org/QA/Tips/reback>[/color][/color]

      And you should really <http://netmeister.org/news/learn2quote.htm l>.


      PointedEars

      Comment

      Working...