From 47fdce547d48fe80bcaac1495bf12c7450a1380e Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 2 Oct 2017 02:12:00 +0200 Subject: [PATCH] page: override request by given script path Support direct requests of page.php/path for internal redirects. --- .htaccess | 2 +- page.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.htaccess b/.htaccess index ef206d7..84f6a8d 100644 --- a/.htaccess +++ b/.htaccess @@ -3,4 +3,4 @@ RewriteBase / # common php handler RewriteCond %{REQUEST_FILENAME} !-f -RewriteRule '' page.php%{REQUEST_FILENAME} [L] +RewriteRule '' page.php [L] diff --git a/page.php b/page.php index 6623c8b..21cc0a0 100644 --- a/page.php +++ b/page.php @@ -56,7 +56,7 @@ $Edit = isset($_GET['edit']); # distinguish subpage Args from topmost Page script $Args = ''; -$Page = preg_replace('/\?.*/', '', $_SERVER['REQUEST_URI']); +$Page = preg_replace('/\?.*/', '', @$_SERVER['PATH_INFO'] ?: $_SERVER['REQUEST_URI']); $Page = urldecode(trim($Page, '/')) ?: 'index'; while (TRUE) { if (file_exists("$Page/.private")) { -- 2.30.0