diff options
author | emkael <emkael@tlen.pl> | 2018-02-02 19:41:22 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2018-02-02 19:41:22 +0100 |
commit | 52aa40b9b8764da2872385fb4ff4155874b28c57 (patch) | |
tree | 95bcd65d8f1ab7d0447e43d27f899ab204731fa4 | |
parent | 16a32604f5f2459418dd94f31de499990f0dfb69 (diff) |
Treating GUID links as redirects
-rw-r--r-- | http/.htaccess | 2 | ||||
-rw-r--r-- | http/index.php | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/http/.htaccess b/http/.htaccess index e3378e5..47c993c 100644 --- a/http/.htaccess +++ b/http/.htaccess @@ -1,2 +1,2 @@ RewriteEngine On -RewriteRule (.*)/(.*).xml /index.php?format=$2&query=$1 +RewriteRule (.*)/(.*).xml(/.*)? /index.php?format=$2&query=$1&pathinfo=$3 diff --git a/http/index.php b/http/index.php index e6474bd..ca9b6ba 100644 --- a/http/index.php +++ b/http/index.php @@ -7,6 +7,13 @@ if (!in_array($format, ['atom', 'rss'])) { die('Invalid feed format.'); } +$pathinfo = trim($_REQUEST['pathinfo'], '/'); + +if (strlen($pathinfo)) { + header('Location: ' . $pathinfo, TRUE, 302); + die(); +} + $params = explode('/', $_REQUEST['query']); if (count($params) < 2) { |