Page MenuHomePhabricator

Special:UrlRedirector error message doesn't display properly due to relative paths/url rewrites
Closed, ResolvedPublic

Description

If you visit http://w-beta.wmflabs.org/123, it displays an unstyled MediaWiki error page (once UrlShortener is actually deployed that url will display a different invalid short code message). This because MW is using relative paths to load.php (/w/load.php) which obviously don't exist on the short domain.

We need to output some kind of error message, is it possible that UrlRedirector can detect if it's on the short domain and redirect to the full one? I'm not sure if that's even possible with how the rewrite rules are set up.

Otherwise we could disable the normal MW output and just send a small plaintext error message.

Event Timeline

Legoktm created this task.Oct 25 2015, 5:18 AM
Legoktm raised the priority of this task from to Normal.
Legoktm updated the task description. (Show Details)
Legoktm added subscribers: Krenair, yuvipanda, Legoktm.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 25 2015, 5:18 AM

is it possible that UrlRedirector can detect if it's on the short domain and redirect to the full one

@Krenair pointed me to https://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers

If we detect that header, we should do a 302 to the main domain else display an error message.

Legoktm claimed this task.Mar 11 2016, 8:21 PM

I think the easiest solution for now will be to use a plain wfHttpError() which does not depend on the MW interface in any way.

Change 276813 had a related patch set uploaded (by Legoktm):
Use plain wfHttpError() if short code is not found

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

Change 276813 merged by jenkins-bot:
Use plain wfHttpError() if short code is not found

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

Legoktm closed this task as Resolved.Mar 11 2016, 11:15 PM