git.shiar.nl
/
sc2-widget
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7a602f8
)
prefer get parameter for apache redirects
author
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 27 Jun 2019 15:14:23 +0000
(17:14 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Wed, 24 Jul 2019 02:11:38 +0000
(
04:11
+0200)
Switching to Apache2's event MPM broke rewrites with path info.
.htaccess
patch
|
blob
|
history
widget.php
patch
|
blob
|
history
diff --git
a/.htaccess
b/.htaccess
index bacadc7435ad759a8b3f598376bffb4b8d03b09e..f28aa3cd195074cde1f0c8dce257ca549573deb5 100644
(file)
--- 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 463ff67f1fef13c14182736797e4aa493c1a99fe..c99611140d654aca1a66b0add7a697e63d0c7a9b 100644
(file)
--- 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;