From 52aa40b9b8764da2872385fb4ff4155874b28c57 Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 2 Feb 2018 19:41:22 +0100 Subject: Treating GUID links as redirects --- http/.htaccess | 2 +- http/index.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3