The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

default new account page

Discussion in 'General Discussion' started by Soheil, Sep 16, 2005.

  1. Soheil

    Soheil Active Member

    Joined:
    Jun 24, 2003
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    When I create an account, and no pages have been uploaded by the user, going to the domain, just lists the contents of the directory:

    Index of /
    Name Last modified Size Description
    --------------------------------------------------------------------------------
    Parent Directory 16-Sep-2005 14:42 -
    cgi-bin/ 16-Sep-2005 14:37 -



    What I would like to have is a default page I see on some sites which says something like:

    This is the placeholder for domain or something similar.

    Can someone please tell me how to do this?
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You can use the /root/cpanel3-skel/public_html directory the contents of which are copied into a new accounts directory structure.
     
  3. jester.ro

    jester.ro Well-Known Member
    PartnerNOC

    Joined:
    Feb 6, 2004
    Messages:
    304
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bucharest, Romania
    cPanel Access Level:
    DataCenter Provider
    or if you're a reseller, look into your home dir for the skel directory, and modify it's contents.

    for what you need, simply placing an index.html with the content you want displayed should suffice.
     
  4. Soheil

    Soheil Active Member

    Joined:
    Jun 24, 2003
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Thanks so much.
    It worked.

    Now, is there a way to automatically show this index for any domain which does have an index page.

    I have about 150 domains which have already been setup and it takes a long time to terminate and recreate them to take advantage of this system.

    Can someone suggest an ulternative please?
     
  5. Soheil

    Soheil Active Member

    Joined:
    Jun 24, 2003
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Also is there a variable or a list of variables that can be used in the index.html file located in cpanel3-skel/public_html whish shows the name of the domain or any additional information?

    I would like to have something like
    This DOMAINNAME has been registered by COMPANYNAME...
    I guess I can hardcode the COMPANYNAME in , but how do I make the DOMAINNAME to show?


    Thanks so much
     
  6. -jdk-

    -jdk- Well-Known Member

    Joined:
    Aug 28, 2005
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6

    If you created them as add-on domains in your one cPanel account, you can create an .htaccess file and put IndexIgnore * in your /public_html directory. This will make it not display the contents on any of the folders. If they each have their own account you will need to include the htaccess file on each account.
     
  7. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Check the postwwwacct scripts in my scripts club link below.
     
  8. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Soheil, in answer to your question, ie how to have your own index page displayed on all the 150 existing accounts, basically the simplest way is to copy in the new index page file to all those accounts. If you have shell access you can do it relatively simply, if not, you need to FTP the file in or use cpanel file upload (doesn't require knowing the user password, as you can get in with your reseller password). There isn't any configuration setting you can use to do this, but the good news is you only have to do it once!

    If you're smart, a quick tip: If you use an index.php file, have it contain only a single line include of the real file from your main reseller account. That way, you can modify the reseller copy and have it apply to all 150 domains instantly. The index.php file that goes in the 150 client directories would look something like (replace 'reseller' with your account name):

    HTML:
    <?php include "/home/reseller/index_holdingpage.php"; ?>
    As far as the question of how you can get the domain name into the default index page, you need to either edit it in at the time you copy the index file in, or write some PHP code to work it out on the fly, those are the two choices, with the PHP method being smarter. Cpanel have recently made this trickier since the file containing the mapping from username to domain name (/etc/userdomains) is now readable only to root and mail. You should be able to use $_ENV['HTTP_HOST'] or $_ENV['SERVER_HOST'] so long as they haven't used ~ notation to access the account, so you can probably get away without /etc/userdomains (both of these contain the www but you can delete that if you just want the domain name).
     
    #8 brianoz, Sep 20, 2005
    Last edited: Sep 20, 2005
Loading...

Share This Page