router working with niceurls
This commit is contained in:
parent
3206110cf4
commit
6fbdeb2b32
1 changed files with 5 additions and 1 deletions
|
@ -5,6 +5,10 @@ if (PHP_SAPI !== 'cli-server') {
|
|||
}
|
||||
|
||||
// warehouse files
|
||||
@include_once "data/config/shimmie.conf.php";
|
||||
require_once "core/sys_config.php";
|
||||
require_once "core/polyfills.php";
|
||||
require_once "core/util.php";
|
||||
$matches = [];
|
||||
if (preg_match('/\/_(images|thumbs)\/([0-9a-f]{32}).*$/', $_SERVER["REQUEST_URI"], $matches)) {
|
||||
header('Content-Type: image/jpeg');
|
||||
|
@ -21,5 +25,5 @@ if (preg_match('/\.(?:png|jpg|jpeg|gif|css|js|php)(\?.*)?$/', $_SERVER["REQUEST_
|
|||
// all other requests (use shimmie routing based on URL)
|
||||
$_SERVER["PHP_SELF"] = '/index.php';
|
||||
$_GET['q'] = explode("?", $_SERVER["REQUEST_URI"])[0];
|
||||
error_log($_GET['q']);
|
||||
error_log($_GET['q']); // if we use a custom handler, we need to do our own access log
|
||||
require_once "index.php";
|
||||
|
|
Reference in a new issue