Retrieving the current URL in the address bar

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

    #1

    Retrieving the current URL in the address bar

    Hi all. I know nothing about javascript, so anything you say will likely be
    news to me. I have a vhost that may have a configuration problem (1 vhost
    is getting way more traffic than it should). I'm wondering if there's a way
    to see the URL that someone used to access this one vhost (i.e., did they
    really type in http://bob.com (or click it somewhere) or did they type
    http://sally.com and bacause my vhost is misconfigued, they're arriving at
    http://bob.com.) I'm guessing that this might be possible with Javascript.
    Thanks for any and all help.


  • Ivo

    #2
    Re: Retrieving the current URL in the address bar

    "cobalt" <curt@spam.o-lot.at-home-computer-support.com> wrote
    <snip> URL that someone used to access this one vhost (i.e., did they[color=blue]
    > really type in http://bob.com (or click it somewhere) or did they type
    > http://sally.com and because my vhost is misconfigued, they're arriving
    > at http://bob.com.) I'm guessing that this might be possible with
    > Javascript.[/color]

    The window.location object will tell you everything you need to know. If you
    have a webpage open now, see it now by typing this in the addressbar:

    javascript: alert(window.lo cation.hostname );

    Thing is, how do you get this information back to the server (you can glue
    this text to the URL of a 1x1 pixel image) and how are you going to log it.
    Considering the current state of affairs, I 'd worry about that first.
    Javascript really isn't meant to solve serverside problems.
    HTH
    Ivo




    Comment

    Working...