By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,452 Members | 974 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,452 IT Pros & Developers. It's quick & easy.

Retrieving the current URL in the address bar

P: n/a
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.
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ivo
"cobalt" <cu**@spam.o-lot.at-home-computer-support.com> wrote
<snip> 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 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


Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.