Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions error.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use $LANG instead of en here, but I figured en is always the best place to direct people.

if ($try) {
status_header(301);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

301 is meant to be permanent, does this mean we'll have a hard time reviving inactive translations?

mirror_redirect($try);
exit;
}
}

// ============================================================================
// 404 page for manual pages (eg. not built language)
Expand Down