From f224d3a2435a8341074685bbf1768bae6c25b2ff Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Mon, 10 Jun 2013 01:26:52 +0200 Subject: [PATCH 1/2] Add redirect for / --- public_html/modules/home.php | 16 ++++++++++++++++ public_html/rewrite.php | 1 + 2 files changed, 17 insertions(+) create mode 100644 public_html/modules/home.php diff --git a/public_html/modules/home.php b/public_html/modules/home.php new file mode 100644 index 0000000..cfcaea1 --- /dev/null +++ b/public_html/modules/home.php @@ -0,0 +1,16 @@ +allow_slash = true; $router->routes = array( 0 => array( + "^/$" => "modules/home.php", "^/list$" => "modules/list.php", "^/register$" => "modules/register.php", "^/login$" => "modules/login.php", From d03feff8c599a2c9dacdd18b3124350dc5105d9d Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Mon, 10 Jun 2013 01:28:19 +0200 Subject: [PATCH 2/2] Handle 404s --- public_html/rewrite.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public_html/rewrite.php b/public_html/rewrite.php index 5ed4d8a..2679ae9 100644 --- a/public_html/rewrite.php +++ b/public_html/rewrite.php @@ -37,4 +37,12 @@ $router->routes = array( ) ); -$router->RouteRequest(); +try +{ + $router->RouteRequest(); +} +catch (RouterException $e) +{ + http_status_code(404); + die("404 Not Found. Click here to continue to todo.cryto.net, the todo list for overworked hackers (and everyone else)."); +}