Skip to content

Instantly share code, notes, and snippets.

@selfawaresoup
Created August 24, 2015 13:52
Show Gist options
  • Save selfawaresoup/2e3c674aab0f85166a0f to your computer and use it in GitHub Desktop.
Save selfawaresoup/2e3c674aab0f85166a0f to your computer and use it in GitHub Desktop.
URL rewriting with exception for static files in PHP's built-in web server
<?php
if (preg_match('/\.(?:png|jpg|jpeg|gif|js|css)$/', $_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