Skip to content

Instantly share code, notes, and snippets.

@DawTaylor
Created November 14, 2016 20:33
Show Gist options
  • Save DawTaylor/f00251482b8e9fb6e3dd4e671c13f248 to your computer and use it in GitHub Desktop.
Save DawTaylor/f00251482b8e9fb6e3dd4e671c13f248 to your computer and use it in GitHub Desktop.
Acts like an .htaccess that redirects all requests to index.php (WP and CI like)
<?php
if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER["REQUEST_URI"])) {
return false;
} else {
$_GET['q'] = $_SERVER['REQUEST_URI'];
include __DIR__ . '/index.php';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment