www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] Get actual URL used to access site?

  1. #1
    Join Date
    Apr 2007
    Posts
    153

    resolved [RESOLVED] Get actual URL used to access site?

    Couple hours of searching and googling have not helped me

    If you have multiple domain names pointing to the same host:

    w3.ineedphphelp.com
    and
    w3.myheadhurts.com
    etc...
    Is there a way to determine which URL was used to access the site?

    I know I can get this if there is an HTTP_REFERER but of course that does not help when the URL is typed into the address bar.

    I tried REQUEST_URI but that did not work.

    What about SCRIPT_URI?

    When I look at SCRIPT_URI it seems to echo what I type in the browsers address bar to access it, but I don't currently have another domain name pointing at it to test, I suspect it will not change.
    Last edited by HazardTW; 07-12-2007 at 02:39 AM.

  2. #2
    Join Date
    Feb 2005
    Location
    Tauranga
    Posts
    2,062
    PHP Code:
    <?php
    $host 
    $_SERVER['HTTP_HOST'];

    if(
    $host == "www.yourdomains.com"){
    // track this domain
    // etc...
    ?>

  3. #3
    Join Date
    Apr 2007
    Posts
    153
    haha, that makes sense, thank you so much! =)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles