# 4Admin™ URL Forwarding Script. © WEBMASTERS.COM. All Rights Reserved.
include ("/usr/local/4admin/apache/htdocs/globals.inc.php");
error_reporting(E_ALL & ~E_NOTICE);
//if ($_REQUEST['url']!="") {
if (!empty($_REQUEST['url'])) {
$url = strtolower($_REQUEST['url']);
$url = preg_replace("[www\.]", "", $url); }
else {
$url = strtolower($_SERVER['HTTP_HOST']);
$url = preg_replace("[www\.]", "", $url); }
Function Forward($loc,$type) {
global $url;
if ($type=="Standard") header("Location: $loc");
else {
echo "
".$url."
"; }}
if ($url=="server2004.com") Forward("index.html","Frame");
elseif ($url=="c1.server2004.com") Forward("http://server2004.com/rdev1","Frame");
else Forward("index.html","Frame");
if ($url!="server2004.com") {
$stats="/usr/local/4admin/apache/vhosts/server2004.com/logs/";
if (is_dir($stats)) {
$file=$stats.$url;
$Stamp=date("d/m/Y:H:i:s");
@$Entry=$REMOTE_ADDR." ".$raw_url." - [".$Stamp."] \"GET / HTTP/1.1\" 200 537 \"".$HTTP_REFERER."\" \"".$HTTP_USER_AGENT."\"\n";
if ($c=fopen($file, "a+")) {
fputs($c, $Entry);
fclose($c); }
elseif ($c=fopen($file, "w")) {
flock($c,2);
fputs($c,$Entry);
flock($c,3);
fclose($c); }}}
?>