Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

csr want subdomains/pointers to use same PHP script

Discussion in 'General Discussion' started by asmithjr, Jul 30, 2004.

  1. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    506
    Likes Received:
    4
    Trophy Points:
    168
    I have a customer with 26 domain names, he wants to have the doamins point to a subdomain once the user enters the domain name.

    Here is the catch. his main domain is running PHP scripts and each subdomain/domain of the 26 are schools. We need to;

    When user types in a domain name that is not the master domain he actually needs to run the maindomain.com/script.php?ID=### but make the url show the subdomain.

    maindomain.com

    anotherdomain.com will redirect to sub.maindomain.com but run the php script maindomain.com/script.php?ID=###
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    506
    Likes Received:
    4
    Trophy Points:
    168
    I put something like this in my index.php
    <?
    $URL = $HTTP_HOST;
    if ($URL != maindomain.com')
    header("Location: http://sub.maindomain.com/script.php?TeamID=0005");
    ?>

    This works but it puts script.php?ID=0005 in the URL also.

    Any way to hide the script.php?ID=0005
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice