shortCodeToUrl($code); header("Location: " . $url); exit; } catch (Exception $e) { // log exception and then redirect to error page. // header("Location: /error"); header("Location: index.php"); exit; }