Skip to content

Instantly share code, notes, and snippets.

@hanikesn
Last active August 29, 2015 14:21
Show Gist options
  • Save hanikesn/ec473561edfdd6f78bdc to your computer and use it in GitHub Desktop.
Save hanikesn/ec473561edfdd6f78bdc to your computer and use it in GitHub Desktop.
PHP Router for static files
// Warning: unsafe, use only in dev enviroment
if(is_file($_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'])) {
header('Content-Type:');
readfile($_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI']);
exit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment