Page 1 of 1

Finding out calling address

Posted: Wed Mar 17, 2004 7:52 am
by Stryks
Hi guys,

Just wondering if anyone could tell me if there is any reliable way of telling what name was used to call my site.

What I am getting at is, if the site is called with my external IP addy, then I want to have all pages referred to with that addy, as opposed to my actual domain name. And vise versa.

Basically, I guess I will need to somehow capture the url used to view the current page ... not the referrer ... just the actual address in the address bar.

Any ideas? Thanks

Posted: Wed Mar 17, 2004 8:18 am
by JAM
Not sure about this one, with a main reason as I can test-and-try this myself, but consider looking into .htaccess use (if using Apache). Might find something interesting using that file.

Posted: Wed Mar 17, 2004 8:22 am
by patrikG
[php_man]gethostbyaddr[/php_man] - doesn't always work reliably, though, but that's the only native PHP command I can think of.