Results 1 to 3 of 3

Thread: sub-domain: where does my index.htm go?

  1. #1
    Join Date
    Apr 2011

    Default sub-domain: where does my index.htm go?

    Perhaps this will be obvious when I define my sub-domains, but my searches in this forum and others come up empty.

    Assume my primary domain is and I create a

    Into the Firefox address-block my user enters : "".

    Where will it find (i.e where do I need to create) the index.htm or equivalent for

    I have found the following (seemingly overcomplicated) script which I gather would be coded into the existing index.php for the main directory . Is this what I need to do?
    -- source: Assuming PHP script. --

    $site_url =  strtolower($_SERVER['HTTP_HOST']);
    if(strpos($site_url,":")) $site_url = substr($site_url,0,strpos($site_url,':'));
    if($site_url == '') header('Location:');
    elseif ($site_url != '')
    if(strpos($site_url,'')) $host_length = strlen('');
    $user = substr($site_url,0,strlen($site_url)-$host_length-1);

  2. #2
    Join Date
    Apr 2008
    Morgan Hill, CA


    When you create a new subdomain, you are prompted to specify a directory for it. Just place your index.html file for the subdomain into whatever directory name you've chosen for the subdomain. (While I'm not really sure what that example from webmasterworld is doing, you certainly don't need to do all that to create and use a subdomain.)

  3. #3
    Join Date
    Apr 2011


    Thanks Bob.

Posting Permissions

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