Skip to content

Instantly share code, notes, and snippets.

@freekrai
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freekrai/98adcad8fb3029c78357 to your computer and use it in GitHub Desktop.
Save freekrai/98adcad8fb3029c78357 to your computer and use it in GitHub Desktop.
Add rewrite capabilites to PHP 5.4's built-in web server
<?php
// php -S localhost:8888 routing.php
if (preg_match('/\.(?:png|jpg|jpeg|gif|css|js)$/', $_SERVER["REQUEST_URI"])) {
return false;
} else {
include __DIR__ . '/index.php';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment