Page MenuHomePhabricator

Links with language variants can't automatically jump to mobile sites
Closed, ResolvedPublic

Description

Links such as http://zh.wikipedia.org/zh/克莱斯勒 cannot automatically jump to mobile version with a mobile user agent. Links like http://zh.wikipedia.org/wiki/克莱斯勒 http://en.wikipedia.org/wiki/Chrysler work pretty well.

The most unfortunate thing is, Google indexed all the /zh/ links instead of /wiki/'s (just search "克莱斯勒 wikipedia" in Google). That means if you use Google to search a Chinese wikipedia page on mobile phone, you have to open a desktop version of that page at the first time, and then manually change to mobile version.

I don't think we have this problem years ago.


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=52429

Details

Reference
bz51753

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:54 AM
bzimport set Reference to bz51753.
bzimport added a subscriber: Unknown Object (MLST).

Likely related to bug 52429, might even depend on it.

Huh is this (Google index) the cause of that issue that I tagged as worksforme in zhwiki VPT?

(In reply to comment #1)

Likely related to bug 52429, might even depend on it.

No, it's not - the cause is the regex that explicitly redirects only URLs with /wiki/. I wonder how this (so horrible that I'm even proud of writing half of it) regex can be tweaked? (wiki|zh|zh-cn|...) is the most straightforward way, however it's prone to going out of sync with reality if we ever add new variants.

This problem keeps going, but I found something interesting about interacting between wikipedia and google search's page.

(all the test is based on: use google.com search "克莱斯勒 wikipedia" and then click the first result to see if it can be redirected to the right mobile site)
In chrome of android, you can correctly redirected to http://zh.m.wikipedia.org/wiki/%E5%85%8B%E8%8E%B1%E6%96%AF%E5%8B%92 after an url jump.

With desktop Chrome + android's version's UA (I use Mozilla/5.0 (Linux; Android 4.1.1; Nexus 7 Build/JRO03D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19, by User-Agent Switcher for Chrome to change it. It's one of default options), you can be redirected correctly as well. But if you use other UA like iPhone/iPad/WP7, it doesn't work.

Note that the redicted link made by google (https://www.google.com/url?sa=t&rct=j&q=%E5%85%8B%E8%8E%B1%E6%96%AF%E5%8B%92%20wikipedia&source=web&cd=1&ved=0CC4QFjAA&url=http%3A%2F%2Fzh.wikipedia.org%2Fzh%2F%25E5%2585%258B%25E8%258E%25B1%25E6%2596%25AF%25E5%258B%2592&ei=j4NlUr73FuPL2gWyhoCAAQ&usg=AFQjCNFYeATKi3bLRCxwbSpe3WQDg5xtgw&sig2=9VFMREvo3wk6fmSNK-hywQ&bvm=bv.54934254,d.b2I) is essential. If you use some add-on/script to remove it, it can't be redirected at all just like click directly on http://zh.wikipedia.org/zh/克莱斯勒 .

It doesn't happen in Firefox, either desktop or android version. In desktop, you can try any of mobile UA (includes the above android chrome one), you will be never redirected to correct mobile page.

The debug info in Chrome may be help (you can reproduce it yourself easily though):
http://snag.gy/neeNH.jpg

(In reply to comment #4)

This problem keeps going, but I found something interesting about interacting
between wikipedia and google search's page.

In case you don't know, zhwiki has a script: https://zh.wikipedia.org/wiki/MediaWiki:Gadget-variant-link-fix.js

  • Bug 66080 has been marked as a duplicate of this bug. ***

Change 137476 had a related patch set uploaded by MaxSem:
Redirect language variant URLs to mobile

https://gerrit.wikimedia.org/r/137476

Change 137476 merged by BBlack:
Redirect language variant URLs to mobile

https://gerrit.wikimedia.org/r/137476

The link in comment 0 looks fine to me now, assuming this was fixed by the above patch. Please do feel free to reopen if that's not the case.