Creating subdomain and redirecting

Discussion in 'PHP' started by Mil1243, Apr 16, 2008.

  1. #1
    hello guys,

    i need help about this issue:

    i have a site (www.mydomain.com) and i want to create a subdomain for each of user who register(www.user.mydomain.com) and user.mydomain.com) and each user enter a URL (www.example.com) and a TITLE that when he visit his subdomain (www.user.mydomain.com and user.mydomain.com), it should redirect him to the URL (www.example.com) with the TITLE that he entered before, I think it is not redirecting because we are using a new URL with new TITLE, maybe it is fetching or something.so there is 2 problem:
    1- how to create subdomains automatically.
    2- how to redirect with the user specification.

    thank u in advance,
     
    Mil1243, Apr 16, 2008 IP
  2. ErectADirectory

    ErectADirectory Guest

    Messages:
    656
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Look into wildcard subdomains (I think HG does allows this). If not HG, get yourself any VPS or Dedicated account that allows shell access.

    Basically it will work like this. ANY subdomain will be redirected to index.php on your root domain. You then can use PHP to strip the subdomain out of the url and can then take that information (username in your case) and do whatever you want to dynamically generate the page.

    So that stuff about TITLE in your post just confused me, not really sure what you mean by that but I'll try to help none the less.
     
    ErectADirectory, Apr 17, 2008 IP