diff options
-rw-r--r-- | data/config.default.php | 8 | ||||
-rw-r--r-- | www/go.php | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/data/config.default.php b/data/config.default.php index acbb139..69d2c25 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -395,6 +395,14 @@ $useredir = false; $url_redir = 'http://www.google.com/url?sa=D&q='; /** + * Enable short URL service. + * Can be used to visit urls using http://example.org/go/shortname + * + * @var boolean + */ +$shorturl = true; + +/** * Array of bookmark extensions that Scuttle should add system tags for. * When adding an URL with one of the given extensions, a system * tag is automatically assigned. @@ -12,6 +12,13 @@ */ require_once '../src/SemanticScuttle/header.php'; +if (!$GLOBALS['shorturl']) { + header('HTTP/1.0 500 Internal Server Error'); + header('Content-Type: text/plain'); + echo 'Short URL service deactivated'; + exit(); +} + if (!isset($_SERVER['PATH_INFO'])) { header('HTTP/1.0 400 Bad Request'); header('Content-Type: text/plain'); |