Mercurial > hg > batmud > alchtool
changeset 85:5307abdc04c7
Updated.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 09 Mar 2015 11:54:44 +0200 |
parents | 7ec0ad742009 |
children | dcbebe8a5f97 |
files | router.php |
diffstat | 1 files changed, 12 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/router.php Mon Mar 09 10:11:04 2015 +0200 +++ b/router.php Mon Mar 09 11:54:44 2015 +0200 @@ -1,13 +1,20 @@ <?php -// The hack to get this working on PHP 5.4 built-in web server -// php -S localhost:8888 router.php -// http://localhost:8888/ +// +// The hack to get this working on PHP 5.4 built-in web server, +// simply run the following: +// +// $ php -S localhost:8888 router.php +// +// Then head your browser to http://localhost:8888/ +// -if (preg_match("/\/[a-z0-9-_]+\.(?:png|jpg|jpeg|gif|css|php)/", $_SERVER["REQUEST_URI"])) - return false; +if (preg_match("/\/[a-z0-9_-]+\.(?:png|jpg|jpeg|gif|css|php|js|txt|ogg|mp3|ttf)/i", $_SERVER["REQUEST_URI"])) + return false; // Serve the requested resource as-is. else { require_once "index.php"; return true; } +else + return false; ?> \ No newline at end of file