<jonathanthio@yahoo.com.sg> wrote in message
news:1116994801.442461.112980@z14g2000cwz.googlegr oups.com...[color=blue]
> Hi,
>
> I have a script called rd.js stored in
http://nudelivelady.com/naked
>
> It contains one line
>
> this.location = "http://naked.nudelivelady.com"
>
> Now, many websites access that script. Any website that access that
> script will be redirected to
http://naked.nudelivelady.com[/color]
websites parse and execute the client-side JavaScript you are including?
Interesting. If you mean that Web sites contain links to that resource
that people click on, then you are depending on them having client-side
JavaScript enabled for your code to work.
[color=blue]
> The problem is I don't know which websites access that script. Because
> when I check the webstats, the referrer is not noted due to the
> redirect.
>
> For example,
>
http://domain.com/blabla.htm
>
> redirects to
http://naked.nudelivelady.com
>
> However, if I check the referrers in webstats, I wouldn't see
>
http://domain.com/blabla.htm
>
> How should I modify rd.js so I can see the referrer?[/color]
The HTTP REFERER is sent at the whim of the user agent, there is no
requirement for any user agent to ever send you a REFERER, or if it does
send you a REFERER, that it is the correct one.
Anyway, the solution is not to "fix" the client-side JavaScript, the
solution is to fix your server so that requests to
http://yourdomain.com/somepath translates to
http://somepath.yourdomain.com.
This could be accomplished using virtual servers or mod_rewrite in
Apache for example. Either of those solutions should preserve whatever
REFERER the user agent chooses to send you.
--
Grant Wagner <gwagner@agricoreunited.com>
comp.lang.javascript FAQ -
http://jibbering.com/faq