SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Location
    Bangladesh
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question create new subdomain based on user info using PHP

    Hi,

    Site scenario: user register/sign up my site then a subdomain will automatically be created based on their username [for example username.example.com]. How can I make this automatically when user sign-up? I like to use only one instance of files of my site but many subdomains. Then how can I display user specific data..May be I can extract the first portion and get the username and fetch the data based on username..

    How can i achieve this: files only in one directory but many subdomains created automatically and utilize the same files?

    FYI I checked the post at http://www.sitepoint.com/forums/show...ight=subdomain
    but still not clear.


    Thanks,
    Rashidul

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Location
    Bangladesh
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone there be able to help on this issue?

  3. #3
    Umm. PHP Guru....Naaaah jaswinder_rana's Avatar
    Join Date
    Jul 2004
    Location
    canada
    Posts
    3,193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    From what I know (and maybe wrong), its 2 part process. Main part is that you need to somehow configure your webserver to "listen" to this new domain. There are 2 ways:
    - Enable wildcard domain for your site (*.site.com). This will make sure that any domain is redirected to the same site (so you can have xxx.site.com) and from there you figure out the subdomain using apache and get username.

    - You add a line to httpd.conf to create a new vhost for every user. Coding aspects is still the same as first option.

    The question now, I guess, is whether you know Apache or not? (assuming you have apache as your webserver).
    ---------------------------
    Errors = Improved Programming.
    My Site

  4. #4
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Location
    Bangladesh
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for ur response. I appreciate it.

    I already get the answer, sorry unable to notify

    http://net.tutsplus.com/tutorials/ph...h-codeigniter/


Tags for this Thread

Bookmarks

Posting Permissions

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