Javascript Redirect

Discussion in 'Javascript' started by jonathan, Aug 22, 2004.

  1. jonathan

    jonathan Guest

    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
    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

    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, Aug 22, 2004
    #1
    1. Advertising

  2. jonathan wrote:

    > Now, I set up a redirection in oldhomepage.com
    >
    > this.location = http://newhomepage.com

    ^ ^
    Won't work. The new value must be quoted.

    > 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


    Yes, indeed.

    > 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?


    You could pass the referring URL as query part component.
    You could also use URL rewrite (Apache: mod_rewrite).

    > Should I put
    >
    > this.location = http://newhomepage.com?referrer=document.referrer


    No.

    > Will that do?


    No, and redirection with client-side scripting is evil[tm].

    <http://www.w3.org/QA/Tips/reback>


    PointedEars
    --
    some day none of this will matter. you'll see.
    Thomas 'PointedEars' Lahn, Aug 23, 2004
    #2
    1. Advertising

  3. jonathan wrote:

    > Thomas 'PointedEars' Lahn [...] wrote [...]:
    >> jonathan wrote:
    >> > Should I put
    >> >
    >> > this.location = http://newhomepage.com?referrer=document.referrer

    >>
    >> No.
    >>
    >> > Will that do?

    > So, how should Ido it then?


    Like this:

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


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


    PointedEars
    Thomas 'PointedEars' Lahn, Aug 27, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dh
    Replies:
    2
    Views:
    524
  2. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,214
    Srowe1975
    Oct 15, 2008
  3. Replies:
    7
    Views:
    12,967
    justingrant
    Oct 18, 2008
  4. Sal
    Replies:
    1
    Views:
    374
  5. Ron Howard
    Replies:
    2
    Views:
    503
    Ron Howard
    Aug 11, 2004
Loading...

Share This Page