array( name => "subdomain", url => "http://sd.example.com", framed => true), friendlyname = Anything. name = The subdomain you want redirected. url = The url it should go to. framed = true / flase If true it will load the url in a frameset (keeping the address in the address bar), if false it will just redirect them. isstats = Optional, true / false. If true, it will replace [domain] in the url with the correct domain, eg going to stats. customer.com will redirect to: http://stats.host.com/script.php?u=customer.com&a=true or: http://stats.host.com/cgi-bin/awstats.pl?config=customer.com etc... title = Optional. The title of the frameset. $missingtext = The html that is displayed if a subdomain is entered that is not in the list. */ $redirects = array( "webmail" => array( name => "webmail", title => "WebMail - DotNetPark", url => "http://newmail.dotnetpark.com/", framed => true), "stats" => array( name => "stats", isstats => true, title => "Statistics - DotNetPark", url => "http://stats.aspx2.dotnetpanel.net/cgi-bin/awstats.pl?config=[domain]", framed => true), "dotnetpanel" => array( name => "panel", title => "DotNetPanel - DotNetPark", url => "http://panel.dotnetpark.com", framed => true), "mysql" => array( name => "mysql", title => "phpMyAdmin - DotNetPark", url => "http://mysql.aspx2.dotnetpanel.net", framed => true), "mssql" => array( name => "sql", title => "WebSqlData - DotNetPark", url => "http://http://sql.dotnetsql.com/", framed => true) ); $missingtext = implode('', file('def.php')); /* ignore below */ $host = strtok($_SERVER['HTTP_HOST'], '.'); $domain = strtok('\0'); foreach ($redirects as $redirect) { strchr($redirect['name'], '.'); } foreach($redirects as $redirect) { if (strcasecmp($redirect['name'], $host) == 0) { if (!$redirect['framed']) { if ( $redirect['isstats'] == true) { $redirect['url'] = str_replace("[domain]", $domain, $redirect['url']); } $url = sprintf("Location: %s", $redirect['url']); header($url); exit(0); } else { if ( $redirect['isstats'] == true) { $redirect['url'] = str_replace("[domain]", $domain, $redirect['url']); } $url = $redirect['url']; $useframes = $redirect['framed']; $title = !empty($redirect['title']) ? $redirect['title'] : $host; } } } if ($useframes && !empty($url)) { ?> <?=$title ?>