Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Nov 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question any ideas would be helpful

    Hello everyone--


    I have a new project that I am unsure of how to do. Here's what I need to do: when a user signs up for this site, I need to create the sub domain: http://newUser.mySite.com where newUser is the new person that signs up. I know that this is possible because I some hosting companies have very similar capabilities with in their control panels. The ISP that I am using to host the site does support sub domains too.

    Also, how can I grab the url the user entered? I need to be able to set variables based on the URL

    i.e. http://user.mySite.com will have user specific elements added from the DB which will be different from http://user2.mySite.com

    Any ideas/help would be greatly appreciated. Thanks.

  • #2
    Regular Coder
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    112
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmm. seems like Deviantart.com did it in a similar manner as what you want. All account holders have their gallery in the form of username.deviantart.com.

    What DA did (my guess) was to make a folder from the root or something like www.da.com/username, then write a htaccess to redirect username.da.com

    Is this what you are looking for?

    As for different user specifications for account, maybe you could create different levels of user rights for them.

  • #3
    New to the CF scene
    Join Date
    Nov 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What do you think about setting up *.site.com as a DNS pointer to site.com and then pulling out the sub domain entered to customize the page for the given user?

    So, for example:

    test.site.com

    would call the pages from site.com which would pull the HOST varialbe and get the 'test' part of the URL to customize the page from the database. What do you think?

  • #4
    New to the CF scene
    Join Date
    Oct 2003
    Location
    Mesa, AZ
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    this should help

    PHP Code:
    <?

    $headers 
    getallheaders();
    $domain_array explode("."$headers["Host"]); 
    $i=sizeof($domain_array);

    while ( (list(
    $k,$v) = each($domain_array)) && $i>2) {
        
    $name .= " " $v;
        
    $i--;
    }

    $naam=ltrim($name);



    $page_title ucwords($naam) . "Nice";
    echo 
    $page_title;
    ?>

  • #5
    New to the CF scene
    Join Date
    Nov 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    working perfectly, thanks for the help.


  •  

    Posting Permissions

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