$uri_parts = explode('?', $_SERVER['REQUEST_URI'], 2); // и затем используем "левую" часть: echo 'http://' . $_SERVER['HTTP_HOST'] . $uri_parts[0];