Skip to content

Conversation

@salathe
Copy link
Contributor

@salathe salathe commented Mar 11, 2019

This patch adds in redirects from manual page links for inactive languages to go to their English equivalent.

For example, since our Bulgarian translation is marked as inactive, visitors going to http://php.net/manual/bg/function.strpos.php will get redirected to http://php.net/manual/en/function.strpos.php

isset($INACTIVE_ONLINE_LANGUAGES[$match[1]])) {
$try = find_manual_page("en", $match[2]);
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?

// 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.

@cmb69
Copy link
Member

cmb69 commented Mar 11, 2019

If someone is looking for a particular translation, telling them the translation would have been moved to EN, seems wrong to me. Instead, I'd prefer to stick with the 404 response (might be changed to 410), and to add a link to the EN version in the response body.

@salathe
Copy link
Contributor Author

salathe commented Mar 11, 2019

@cmb69 from most of the complaints thus far, it seems to be Google directing folks to the translated pages, not necessarily a specific choice on the part of the user.

This should really be "fixed" by Google no longer sending visitors to those pages now that they just serve a 404 page.

@salathe
Copy link
Contributor Author

salathe commented Mar 26, 2019

Superseded by friendlier error page in 4716c2b.

@salathe salathe closed this Mar 26, 2019
@salathe salathe deleted the bug-77637-inactive-language-redirect branch March 26, 2019 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants