Page MenuHomePhabricator

Non-Safari iPhone User Agent Not Redirecting Automatically
Closed, ResolvedPublic

Description

Author: smlawsky

Description:
Is the server that distributes mobile device views of Wikipedia pages having problems the last few days?

No mobile view is noted on the iPhone devices as of Monday, Feb 7, 2011.


Version: 1.0.0 (Android)
Severity: enhancement

Details

Reference
bz27257

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:19 PM
bzimport set Reference to bz27257.
bzimport added a subscriber: Unknown Object (MLST).

I don't have an iPhone, but when I set my user agent to act like an iPhone, it worked. Maybe this was temporary? Re-open if this is still a problem for you.

smlawsky wrote:

It is not working on the iPhone 4 running the latest operating system iOS 4.2 or the Mac iphone SDK development simulator.

This is a recent problem because it worked before last week.

It has gone down several times in the past year.

Using the list of UAs I downloaded from http://techpatterns.com/forums/about304.html, I was able to verify that iOS 4.2.x does not redirect but iOS 4.0 does.

smlawsky wrote:

Can this be fixed by the Wikipedia Server guys or is it an SDK fix at Apple.
Do you know?

hcatlin wrote:

Its definitely not the server being down, just to be clear. We've been struggling with new tablet devices (not redirecting them, but redirecting their smaller counterparts) and so have been tweaking the UserAgent matching.

This should be fixed in r81728 which is pending deployment.

hcatlin wrote:

Also, can you provide the User Agent string that is *not* redirecting, so I can add it to our test suite.

smlawsky wrote:

The redirect to Mobile view works OK if the iPhone 4 is running iOS 4.2 Safari Browser.
However, it is not working like it did with Apple browser sample code we installed in our app.
That worked until SDK version 4.0 came along, for the the prior year most of the time.
We don't deploy the Safari browser because it forces the user out of our medical iPhone app.

Something changed along the way as you have pointed out.
We are hoping it can be fixed again to redirect as it did previously using url strings like this:

http://en.wikipedia.org/wiki/Breech_birth

Those are the strings that redirected in the past.

I notice that the newest iPhone Safari browse does redirect to the Mobile views OK.
Safari seems to be a smart enough agent to insert another character into the string above when a
Google search is done on Breech Presentation.

When the link is selected:

Breech birth - Wikipedia, the free encyclopedia

it goes to:

http://en.m.wikipedia.org/wiki/Breech_birth

Notice that it ads an m to the string automatically and that produces the Mobile View

hcatlin wrote:

Ah, right. So its not supposed to redirect non-safari browsers on the phone.

All you have to do in your app is to add the "m" after the en and you can have the whole
thing work better anyway.

smlawsky wrote:

But it did work previously.

The string with the without the M is needed on the iPad to NOT direct to the Mobile view.

Ours is a universal app.

The string is generated by tapping the search engine link.

smlawsky wrote:

I will be working with my programmer to rewrite our code to redirect to the Mobile format server like the Safari browser does on the iPhone.

It would be better if Wikipedia could see the device type and redirect automatically ... IMO.

I will post our thread at the Apple iOS developer forum for others to figure out.

My user agent is:

Monzilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9
(KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5

After talking with Hampton, I need to know if you can supply a CSS file that will work with that user agent, or if the current one is satisfactory. Once he knows that he can update the UA string for the mobile proxy.

smlawsky wrote:

This problem with redirect to the Mobile Wikipedia server occurs when I tap Google search links to content on Wikipedia using the iPhone and the User Agent above. We do not post content ourselves for websites that we search for.

hcatlin wrote:

The CSS is not the problem. This is a temporary bug that has already been fixed in the redirect
code.

That should be the title of the bug.

As I say that, i will go change it.

WATCH THIS SPACE.

smlawsky wrote:

Hope it fixes it.

Will Watch and let you know.

It has been been sporadic over the past year.

(Redirecting to Mobile and then Not)

Hope the fix works and will stick in future iterations.

Lots of apps that do not use iOS Safari on iPhones with Apple's prior UIWebView Kit Code.

smlawsky wrote:

Not sure how long changes to propagate.

No change regarding above redirect fix is noted as of 0700 UTC

Wednesday, February 16, 2011

smlawsky wrote:

Some pages are now opening after a short delay to the redirected mobile view after tapping on a search engine link. However some pages remain in the regular wikipedia view.

When this was working well previously there was no delay of going the the wikipedia view first and then to the mobile site. It just immediately directed to the mobile site on the iPhone with the UIWebView Code from Apple that we use.

Some pages are not redirecting:

This link redirects after going to the regular wikipedia view initially.

Shoulder dystocia - Wikipedia, the free encyclopedia

This link does not redirect on the iPhone after going to the regular wikipedia view initially.

Breech birth - Wikipedia, the free encyclopedia

It looks like it is starting to work but not entirely like it was.

smlawsky wrote:

More pages are redirecting now on the iPhone... but there are some outliers that are not redirectine.

eg.

Breech birth - Wikipedia, the free encyclopedia ... is now redirecting to the mobile wikipedia pages.

But these still are appearing on the regular Wikipedia pages on the iPhone when a search link is tapped:

These are not redirecting to the Mobile pages.

3-beta-HSD - Wikipedia, the free encyclopedia

3-Hydroxy-3-methylglutaryl-coenzyme a lyase deficiency - Wikipedia, the free encyclopedia

3-Methylcrotonyl-CoA Carboxylase Deficiency - Wikipedia, the free encyclopedia

smlawsky wrote:

When selecting the Google link:

3-beta-HSD - Wikipedia, the free encyclopedia

it links the mobile page on Wikipedia via:

http://en.m.wikipedia.org/wiki/3-beta-HSD?wasRedirected=true

Most of the Google links do open into the Mobile site using the iPhone 4 iOS 4.2 Browser now like the following link.

However, there are still a number of problem areas:

When selecting the Google link:

2,4-Dienoyl-CoA reductase deficiency - Wikipedia, the free ...

The browser attempts to open:

http://en.wikipedia.org/wiki/2,4_Dienoyl-CoA_reductase_deficiency

This opens the regular Wikipedia page instead of the Mobile link:

http://en.m.wikipedia.org/wiki/2,4_Dienoyl-CoA_reductase_deficiency

A similar problem occurs when trying to link to:

3-hydroxy-3-methylglutaryl-CoA lyase deficiency - Wikipedia, the ...

This goes to the regular Wikipedia Page:

http://en.wikipedia.org/wiki/3-hydroxy-3-methylglutaryl-CoA_lyase_deficiency

instead of the one that opens the mobile wikipedia page.

http://en.m.wikipedia.org/wiki/3-hydroxy-3-methylglutaryl-CoA_lyase_deficiency

Other google search links on the iPhone that truncate do not seem to redirect to the mobile Wiki pages when tapped either:

3-Methylcrotonyl-CoA carboxylase deficiency - Wikipedia, the free ...

Is the any way to have the longer truncated link redirect when selected:

smlawsky wrote:

Looks like its fixed now.

Thanks a lot for your kind help!

Hope it continues to work in the future.

I'll make a donation to Wikipedia.

Steve Mlawsky, M.D.
C.E.O., IatroCom

smlawsky wrote:

Everything was working OK until I just noticed a failure of all weblink redirects to the Wikipedia Mobile servers at 5:47 UTC Monday, March 7, 2011 while using iPhone 4 as previously discussed in this bug report. What happened?

hcatlin wrote:

This is a separate issue.

Nothing is redirecting right now because of some changes to Mediawiki that broke ALL redirection. :P

I'll open another ticket for it.

smlawsky wrote:

Appreciate if this can be stabilized.

The behavior has been erratic with many episodes over the last year will loss of mobile site redirect.

Seems it keeps breaking down periodically.

I have at least 200 doctors using an app that may access the mobile links...

Thanks for prompt help with this issue.

smlawsky wrote:

Appreciate if this can be stabilized.

The behavior has been erratic with many episodes over the last year will loss of mobile site redirect.

Seems it keeps breaking down periodically.

I have at least 200 doctors using an app that may access the mobile links...

Thanks for prompt help with this issue.

smlawsky wrote:

Some web links are beginning to redirect now to the Mobile Web Page site(s) from iPhone4 client.

This occurs OK when hyper text words in Wikipedia articles are tapped.

e.g.

Acrocallosal Syndrome
Agenesis of the Corpus Callosum

When search engine links are tapped for the same words:
These open appropriately to the redirected pages as well.

However, there are still other web pages that are NOT redirecting to the Mobile pages yet:

Basal Cell Nevus Syndrome
Bardet-Biedl Syndrome

Evidently Mobile content is spread across a number of asynchronous server sites.
The fixes do NOT appear to propagate at one time to redirect these functions to work globally.

Hopefully, when all of this is reset again it will stay up in the future and not keep going down.

Perhaps, having the option to turn off Mobile displays is confounding things some place.

(In reply to comment #24)

Evidently Mobile content is spread across a number of asynchronous server
sites.

It's probably just that we use quite aggressive caching.

smlawsky wrote:

What occurred after this was all fixed over the last month and working nicely?

Now it is not working again.

smlawsky wrote:

When will this be working again?

How long is the iPhone redirect to Wiki Mobile sites take to repair?

Per 24859. We've increased the number of UA's detected quite drastically.

Resolving. All the iOS server redirects are now in place. If this is still happening please re-open and tell us the UA that is still seeing this.