$headers = getallheaders(); $domain_array = explode(".", $headers["Host"]); // Get the domain name $i=sizeof($domain_array); // Put everything before really into a string, strip off last 2 words (reallyfuckingsucks com) while ( (list($k,$v) = each($domain_array)) && $i>2) { $name .= " " . $v; $i--; } $name=ltrim($name); // strip leading whitespaceIn the Apache .conf file for the virtual server:
ServerAlias reallyfuckingsucks.com *.reallyfuckingsucks.comAnd in named/master/reallyfuckingsucks.com
* IN A 10.0.0.0substitute 10.0.0.0 with the server ip
(c) copyright 2000-2002 Copyrights.reallyfuckingsuck.com, Inc. All rights reserved. Patent Pending. As seen on TV. Some assembly required. Substantial penalties for early withdrawal. May contain small parts. By reading this, according to UCITA, you agree to abide by just about any conditions we feel like. Life contains substantial risk of litigation; please consult a lawyer before breathing. This isn't trademarked by me. It may be your trademark. It may belong to somebody you know. I don't care.. sue somebody else if I'm using it improperly.