From: Mischa POSLAWSKY Date: Thu, 27 Jun 2019 15:14:23 +0000 (+0200) Subject: prefer get parameter for apache redirects X-Git-Tag: v0.5~9 X-Git-Url: http://git.shiar.nl/sc2-widget/commitdiff_plain/7f3d75fcd1ed43c99397a99bda9c14f18b7e068c prefer get parameter for apache redirects Switching to Apache2's event MPM broke rewrites with path info. --- 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;