if (!empty($_GET)) {
$new_get = array_filter($_GET);
if (count($new_get) < count($_GET)) {
$request_uri = parse_url('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], PHP_URL_PATH);
header('Location: ' . $request_uri . '?' . http_build_query($new_get));
exit;
}
}