Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

automatic sub domain creation

Options
  • 22-08-2008 9:03pm
    #1
    Registered Users Posts: 648 ✭✭✭


    hi

    im working on a php site - i want to be able to create subdomains easily from my php script so as they redirect to pages on my site

    eg

    one.domain.com -> index.php?user=one
    john.domain.com -> index.php?user=john


    anyone know how to do this?

    many thanks


Comments

  • Registered Users Posts: 3,886 ✭✭✭cgarvey


    Use wildchar/wildcard DNS ( I.e. *.domain.com > 1.2.3.4 ) and either use the host request header in your PHP scripts to see what was domain accessed, or use mod_rewrite in a .htaccess to do a redirect.

    Your domain host/registrar/reseller will need to support wildchar/wildcard DNS records (and most big ones do). If not you can move your DNS to a more capable provider (and still use your current host, if you like).

    Your host will also need to have support for the wildchar/wildcard sub-domain in their web server config (or maybe a fixed IP address would be an alternative, even if it does cost a bit more).


Advertisement