From: Mischa POSLAWSKY Date: Mon, 2 Oct 2017 00:12:00 +0000 (+0200) Subject: page: override request by given script path X-Git-Tag: v2.3~5 X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/47fdce547d48fe80bcaac1495bf12c7450a1380e page: override request by given script path Support direct requests of page.php/path for internal redirects. --- 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")) {