/* svn --force-log commit DEFAULT.php -m"DEFAULT.php"; scpt -a DEFAULT.php Page type: 0 - Everything else: welcome 1 - Holding page & example 2 - Did you mean? (no www.) 3 - Default backup server 4 - Service page */ $top=0; if (preg_match('/^www\d?\.tv-science\.co\.uk$/',$_SERVER['SERVER_NAME'])) { $top=1; $domain='my-parked-domain.com'; // Example domain } elseif (preg_match('/^(n|ww)\d+\.tvscience\.co\.uk$/',$_SERVER['HTTP_HOST'])) { $top=4; $domain=$_SERVER['HTTP_HOST']; } else { /* SERVER_NAME should be empty now. HTTP_HOST has to be sanitised, should be hostname[:port] Make a rough match to a domain, IPs won't work please note. */ $domain=strtolower($_SERVER['HTTP_HOST']); if (preg_match('/^([a-z0-9-.]{2,}\.[a-z]{2,3})(:80|:8080|)$/',$domain,$bits)) { $domain=$bits[1]; $ip=gethostbyname($domain); if ($ip==$_SERVER['SERVER_ADDR']) { ## Us then if (preg_match('/^ww[w\d]?\.(.*)/',$domain,$bits)) { $top=1; $domain=$bits[1]; # Lop the www. or ww1. or ww2. } else { $top=2; header('Cache-Control: max-age=604800'); # 7-days } } elseif (strpos('X'.$_SERVER['BACKUP_ADDRS'],$ip)) { ## Backup then $top=3; header('Status: Service Unavailable',TRUE, 503); header('Retry-After: 120'); header('Cache-Control: private no-cache no-store'); } } } ?>
}?>
| ||
tvScience clients include:
Your IP address has been logged as: ${_SERVER['REMOTE_ADDR']}"; }; ?> | ||
|
Latest Supervisor login for this server: 00:00:00 GMT on 1st January 1970. }?> | ||
|
| ||