Retrieving the current URL in the address bar

C

cobalt

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

Ivo

cobalt said:
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.

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top