view router.php @ 85:5307abdc04c7

Updated.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 09 Mar 2015 11:54:44 +0200
parents e08f80b95910
children dcbebe8a5f97
line wrap: on
line source

<?php
//
// 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|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;
?>