From 7f3d75fcd1ed43c99397a99bda9c14f18b7e068c Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 27 Jun 2019 17:14:23 +0200 Subject: [PATCH] prefer get parameter for apache redirects Switching to Apache2's event MPM broke rewrites with path info. --- .htaccess | 2 +- widget.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.htaccess b/.htaccess index bacadc7..f28aa3c 100644 --- a/.htaccess +++ b/.htaccess @@ -2,4 +2,4 @@ AddHandler application/x-httpd-php php RewriteEngine on RewriteCond %{REQUEST_FILENAME}.php -f -RewriteRule ^([^/]+)(.*) $1.php$2 +RewriteRule ^([^/]+)(.*) $1.php?clan=$2 diff --git a/widget.php b/widget.php index 463ff67..c996111 100644 --- a/widget.php +++ b/widget.php @@ -17,7 +17,7 @@ function error($message, $status = 500) exit; } -$request = trim($_SERVER['PATH_INFO'], '/'); +$request = trim($_GET['clan'] ?? $_SERVER['PATH_INFO'], '/'); $target = "data/$request.json"; $last = file_exists($target) ? lstat($target)['mtime'] : 0; -- 2.30.0