changeset 74:e08f80b95910

Add PHP router script.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 13 Mar 2014 00:32:14 +0200
parents 61292cb4e59c
children 4876f777a648
files router.php
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/router.php	Thu Mar 13 00:32:14 2014 +0200
@@ -0,0 +1,13 @@
+<?php
+// The hack to get this working on PHP 5.4 built-in web server
+// php -S localhost:8888 router.php
+// http://localhost:8888/
+
+if (preg_match("/\/[a-z0-9-_]+\.(?:png|jpg|jpeg|gif|css|php)/", $_SERVER["REQUEST_URI"]))
+  return false;
+else
+{
+  require_once "index.php";
+  return true;
+}
+?>
\ No newline at end of file