Printed September 9, 2010 from B&T's Tips & Scripts
http://tips-scripts.com
Undefined subdomains
If you use wildcard subdomains so that any subdomain will go to your domain name, you can use this code to strip off the subdomain. The url will then show your domain name without the undefined subdomain.