Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Oct 2006
    Posts
    5

    Default Display website address when setting up new account

    Hi Everyone,
    When setting up a new hosting account through the WHM, is it possible to automatically display the website address on the home page? For example, when setting up a new account the default page would read "Welcome to www.new-hosting-account-domain-name.com" with the web address being automatically included in the page

    Currently, I just edit the page manually.

    Any help is appreciated!

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by daverad View Post
    Hi Everyone,
    When setting up a new hosting account through the WHM, is it possible to automatically display the website address on the home page? For example, when setting up a new account the default page would read "Welcome to www.new-hosting-account-domain-name.com" with the web address being automatically included in the page

    Currently, I just edit the page manually.

    Any help is appreciated!
    If you're talking about the files in your skeleton directory being copied to that account, why not change index.html to index.php and have a little snippet of PHP code to display that information based off the URL requested?

  3. #3
    Member
    Join Date
    Oct 2006
    Posts
    5

    Default

    Thanks David. That is what I am looking for but I don't know what code to include on the page. Would you be able to tell me what that code is or give me some advice where I could find that information?

    Regards,
    Dave

  4. #4
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by daverad View Post
    Thanks David. That is what I am looking for but I don't know what code to include on the page. Would you be able to tell me what that code is or give me some advice where I could find that information?

    Regards,
    Dave
    You may want to use:

    PHP Code:
    <?php echo $_SERVER["HTTP_HOST"]; ?>
    ... where you want to display the domain name.


    For example, your old HTML code may be:

    HTML Code:
    <h1>Welcome to MyDomain.com!</h1>
    To make the code dynamic so it changes based on what domain the user is visiting, you would rename the file in your skeleton directory from index.html to index.php (so PHP code will be interpreted) and change HTML code (based off the above example) as follows:

    HTML Code:
    <h1>Welcome to <?php echo $_SERVER["HTTP_HOST"]; ?>!</h1>
    For more documentation on PHP variables like this, check out this PHP documentation page:

    http://us3.php.net/manual/en/reserve...riables.server

  5. #5
    Member
    Join Date
    Oct 2006
    Posts
    5

    Default

    Thanks for your help, David. That is very helpful!

Similar Threads & Tags
Similar threads

  1. My main account - There is no website configured at this address.
    By kappler0 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 09-09-2006, 05:46 PM
  2. My website will not display
    By TYRANT in forum New User Questions
    Replies: 2
    Last Post: 10-07-2004, 03:45 PM
  3. setting tomcat DISPLAY environment variable
    By kjwilde in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-18-2004, 05:57 PM
  4. All sites display ... There is no website configured at this address
    By asuservice in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-10-2004, 10:44 AM
  5. Replies: 4
    Last Post: 05-03-2004, 02:21 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube