Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2005
    Silicon Valley

    Lightbulb Can I make all possible subdomains forward?

    I would like something like this:

    In any browser someone types:

    I would like the same forwarding for "anysubdomain" where "anysubdomain" can be anything that is well formed.

    Then I would like to grab the subdomain name that was used, parse it with cgi or some other kind of script, and based on the subdomain string decide what to do with it within the script.

    So, for example, joe blow at his browser types in:

    where we will pretend that is my domain, and this gets forwarded to something like or perhaps

    Before anything is displays, my script parses out "IamTiredTonight", and notices it has the string "Tired" embedded in it, and decides to crunch out html code which deals with all subdomains with the word "Tired" embedded in them. real question is whether I can always grab all subdomains and redirect them to my site and then conditionally control them?

    Last edited by JohnTheS; 07-22-2005 at 12:21 AM.

  2. #2
    Join Date
    Nov 2001
    The South
    Yes you can do that, use a wildcard dns entry such as
    * IN A <ipaddress>

    Then on the host you can set a wildcard alias as well as whatever subdomains you want so that <whatever> goes to say, but say, goes to say /squirrelmail/ or whatever.

    As for the parse with cgi that I think is possible but haven't done something like that myself so maybe someone else can comment on a real world setup for doing just that.
    Gary Harris - the artist formerly known as Dixiesys
    resident grumpy redneck

  3. #3
    Join Date
    Feb 2005
    ideally if you had a wildcard dns record, yes, you could do this, but it will depend on what DNS software you are using.

  4. #4
    if you are using cpanel. Check the subdomain section! - ★★ Managed VPS / Budget Servers / Colocation ★★
    Facilities : Atlanta, Buffalo and Las Vegas
    Web : http://www.serverlogix.comContact Us

Posting Permissions

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