From a8bfe46c686ec8dc2c34c588ba381f098058d273 Mon Sep 17 00:00:00 2001 From: Peter Cowburn Date: Mon, 11 Mar 2019 14:02:42 +0000 Subject: [PATCH] Redirect from inactive languages to EN (doc bug #77637) --- error.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/error.php b/error.php index adefef13ea..2743865a56 100644 --- a/error.php +++ b/error.php @@ -635,6 +635,17 @@ } } +// ============================================================================ +// For manual pages for inactive languages, if the EN page exists, redirect there +if (preg_match("!^manual/([^/]+)/([^/]+).php$!", $URI, $match) && + isset($INACTIVE_ONLINE_LANGUAGES[$match[1]])) { + $try = find_manual_page("en", $match[2]); + if ($try) { + status_header(301); + mirror_redirect($try); + exit; + } +} // ============================================================================ // 404 page for manual pages (eg. not built language)