Page MenuHomePhabricator

m.wikipedia.org and zero.wikipedia.org should redirect differently
Closed, ResolvedPublic

Description

Original report

http://m.wikipedia.org currently redirects to http://en.m.wikipedia.org

I don't believe m.wikipedia.org previously redirected in this way. The current behavior seems broken. The markup of http://www.wikipedia.org was specifically updated to better accommodate mobile users (responsive design with @media queries) and it makes logical sense that wikipedia.org and m.wikipedia.org should point to the same page content, I think.

(It seems http://www.m.wikipedia.org works as expected.)

I guess the first step here would be to figure out whether the current behavior is intentional.

Update, 2018-06-27

FromTo
m.wikipedia.orghttps://www.wikipedia.org/
www.m.wikipedia.orgNXDOMAIN
zero.wikipedia.orghttps://www.wikipedia.org/
www.zero.wikipedia.orghttps://www.wikipedia.org/

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

T78421 has been done for all the other sites. The only site left is m.wikipedia.org

DFoy set Security to None.
Dereckson subscribed.

Let's keep the zero. domain like this, as it's advertised to be used directly as http://zero.wikipedia.org at least by one operator and let's apply to m.wikipedia.org the same behavior than in T78421.

Change 285936 had a related patch set uploaded (by Dereckson):
Redirect m.wikipedia.org to portal

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

We should probably look at aligning the varnish mobile-related redirect/rewrite with these changes as well, to avoid gratuitous redirects and rewrites. There are two separate areas in the VCL where this stuff is affected in different ways:

  • The mobile-redirect code:
  • The mobile-rewrite code:
    • Varnish rewrites mobile hostnames to equivalent desktop hostnames
    • It adds X-Subdomain along the way to signal to MobileFrontend that this is a mobile view.
    • This is all in cluster_fe_recv_pre_purge, starting currently around line 78
    • If www.$project is meant to be a desktop view (of HTML that happens to be mobile-friendly, as opposed to MFE), then we should stop doing the hostname-rewrite + X-Subdomain logic on the www names
    • (and the m-dot names too, if they're just going to be apache redirects to the www names).

Given this would probably redirect to https://www.wikipedia.org/ probably something of concern to discovery team.

Is there a chance that this will actually be implemented any time soon?

Is there a chance that this will actually be implemented any time soon?

I don't think so. This doesn't seem to be high enough priority for us to work on any time soon, based on what I see here.

<VirtualHost *:80>
    ServerName m.wikipedia.<%= @domain_suffix %>
    ServerAlias zero.wikipedia.<%= @domain_suffix %>
    UseCanonicalName off

    DocumentRoot /srv/mediawiki/docroot/m.wikipedia.org
    <IfModule mod_php5.c>
        php_admin_flag engine on
    </IfModule>

    RewriteEngine On

    # Everything will be redirected to the appropriate lang.m.wikipedia.org or lang.zero.wikipedia.org based on zero configuration @ meta
    RewriteRule ^/$ /w/mobilelanding.php [L]
</VirtualHost>

Seems like this domain is used for Zero and we can't easily redirect it to the www portal.

We could just split zero to a separate VHost?

We could just split zero to a separate VHost?

Yes, that's something I offered to do here: https://gerrit.wikimedia.org/r/#/c/285936/1/modules/mediawiki/templates/apache/sites/wwwportals.conf.erb

Krinkle subscribed.

Note that as of writing (November 2017) the "m.wikipedia.org" and "zero.wikipedia.org" landing domains do actually redirect to www.wikipedia.org.

However I'm not entirely sure whether this happened intentionally or not.

<VirtualHost *:80>
    ServerName m.wikipedia.<%= @domain_suffix %>
    ServerAlias zero.wikipedia.<%= @domain_suffix %>
    # [..]
    RewriteRule ^/$ /w/mobilelanding.php [L]
</VirtualHost>

This apache code is not actually being reached because our Varnish code at https://github.com/wikimedia/puppet/blob/4124a2e2da85b12633040e6901c1e1ad955c8fd2/modules/varnish/templates/text-frontend.inc.vcl.erb#L99-L106 appears to be rewriting the hostname from en.m.wikipedia.org -> en.wikipedia.org and from m.wikimediafoundation.org to wikimediafoundation.org, but also from m.wikipedia.org and zero.wikipedia.org to bare wikipedia.org - which ends up in the unconditional redirect from wikipedia.org to www.wikipedia.org.

As such https://m.wikipedia.org and https://zero.wikipedia.org are responded to with plain redirect to https://www.wikipedia.org the same as if the request were for other non-canonical entry points such as https://wikipedia.org.

Given the existence of this task, I guess that was desirable by some. However, given the existing configuration of m/zero.wikipedia for Apache that is now unreachable and the existence of mobilelanding.php and related code such as ZeroBanner::getLandingRedirect() - this is probably not intentional and is in need of urgent review by someone who knows this code.

Krinkle renamed this task from m.wikipedia.org incorrectly redirects to en.m.wikipedia.org to m.wikipedia.org and zero.wikipedia.org should redirect how/where.Nov 14 2017, 11:07 PM
Krinkle changed the task status from Stalled to Open.
Krinkle raised the priority of this task from Medium to High.
Krinkle removed a subscriber: wikibugs-l-list.

It looks like the new redirect behavior was introduced in January (https://gerrit.wikimedia.org/r/#/c/333158) to help with site associations configuration for the Wikipedia iOS app (T155504). It doesn't look like the special Zero logic around m-dot and zero-dot domains was accounted for. That change should probably be reverted.

@JoeWalsh (iOS tech lead) is testing whether these redirects are actually necessary for their config at all. Per the relevant Apple docs we suspect they aren't.

Change 285936 abandoned by Dereckson:
Redirect m.wikipedia.org to portal

Reason:
Old change > 1y

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

Confirmed that we can remove the *.m.wikipedia.org from the config and the OS will stop requesting the app-site-association file from *.m., but will still forward *.m. URLs. If we could wait on the server-side change until we can release an update, it'd prevent any breakage from older clients.

@Mholloway spoke with @JoeWalsh about the timing and targeting first week of January seems reasonable. Can you check back in with @JoeWalsh that week to make sure we are a go?

The release with the iOS fix went live today. It will take a bit for updaters but I think we'll be ready for this change by next week.

Sandraramirez3888 renamed this task from m.wikipedia.org and zero.wikipedia.org should redirect how/where to Medí.Dec 9 2017, 12:36 PM
Sandraramirez3888 claimed this task.
revi renamed this task from Medí to m.wikipedia.org and zero.wikipedia.org should redirect how/where.Dec 9 2017, 12:36 PM

Change 404158 had a related patch set uploaded (by Mholloway; owner: Mholloway):
[operations/puppet@production] Stop rewriting m.wikipedia.org and zero.wikipedia.org

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

Hi @DFoy,

As described above in T69015#3761037, the Zero landing page previously accessible via m.wikipedia.org or zero.wikipedia.org is no longer reachable. I believe this was broken over a year ago by an unrelated routing change (see https://gerrit.wikimedia.org/r/#/c/333158/) which causes both subdomains to redirect to www.wikipedia.org.

I've proposed to revert the breaking change (see https://gerrit.wikimedia.org/r/#/c/404158/) but there's some discussion on Gerrit of leaving the new redirect to www. in place. Of course this has potential implications for any currently active Zero partner operators. I'm wondering, do any current Zero partners intend to use the Zero landing page via m. or zero.wikipedia.org? The change does seem to have gone unnoticed for quite some time. If the landing page redirect is no longer needed, then perhaps it's indeed better to keep the new redirect to www. in place and to remove the underlying landing page code.

Thank you!

Hi @DFoy, checking on this - do you have any follow up? Thanks!

Change 404158 abandoned by Mholloway:
Stop rewriting m.wikipedia.org and zero.wikipedia.org

Reason:
Probably best to let the status quo be at this point, absent any urgent reasons not to.

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

Jdforrester-WMF renamed this task from m.wikipedia.org and zero.wikipedia.org should redirect how/where to m.wikipedia.org and zero.wikipedia.org should redirect differently.Jun 27 2018, 9:50 PM
Jdforrester-WMF updated the task description. (Show Details)
Jdforrester-WMF subscribed.

AFAICT this looks done?

MZMcBride claimed this task.

Yessir. Thank you for noting the behavior as of 2018-06-27 in this task!