$x = $_SERVER["QUERY_STRING"]; if ($x != "") { $y = "Location: http://".$_SERVER['SERVER_NAME']."/archive.php?tag=".$x; } else $y = "Location: http://".$_SERVER['SERVER_NAME']."/archive.php"; header($y); ?>