$uri = '/example/my/test////page/////';
$uri = preg_replace('#[/]{2,}#', '/', $uri);
echo $uri;
$uri = $_SERVER['REQUEST_URI'];
$new_uri = preg_replace('#[/]{2,}#', '/', $uri);
if ($uri != $new_uri) {
header('Location: ' . $new_uri);
exit();
}