view router.php @ 74:e08f80b95910

Add PHP router script.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 13 Mar 2014 00:32:14 +0200
parents
children 5307abdc04c7
line wrap: on
line source

<?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;
}
?>