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