Page MenuHomePhabricator

Short URLs not working on IIS for articles with special characters
Closed, DeclinedPublic


Coying here the problem reported in Support Desk (in URL):

I've just upgraded from 1.19 to 1.23 and since that the short URLs only works, if the title contains ASCII characters only. If there are czech national characters in the title, the page is not found, because the national characters are wrongly encoded. I can still open the pages using short URLs, when I enter the short URL directly into the navigation bar. So redirection in my IIS7 seems to work normally. If I disable the short URLs by $wgArticlePath, it works

IIS7 logs:
'''1) short Url disabled'''

GET /w/index.php title=Hlavn%C3%AD_strana 80 * 304 0 0 281

'''2) short Url enabled'''

GET /w/index.php title=HlavnĂ_strana 80 * 404 0 0 140

From the logs it is clear, that if short URL is disabled the title is escaped, but if short URL is enabled, it is not escaped (and probably in wrong encoding).

I found something related in the HISTORY file:

$wgUsePathInfo = true; is no longer needed to make $wgArticlePath work
on servers using like nginx, lighttpd, and apache over fastcgi. MediaWiki
now always extracts path info from REQUEST_URI if it's available.

Which corresponds to this:

_SERVER["REQUEST_URI"] = "/HlavnĂ­_strana"
_SERVER["QUERY_STRING"] = "title=Hlavn%C3%AD_strana"

It seems, that while the article name is correct in _SERVER["QUERY_STRING"] variable, the _SERVER["REQUEST_URI"] contains it invalid encoded.

The commit mentioned in HISTORY is 9d837976314a88918ad20d92c66da704043190e0 (gerrit change 3680)

I haven't tested it. It's listed as "Configuration changes in 1.20"

Version: 1.24rc
Severity: normal
OS: Windows Server 2008
Platform: PC



Event Timeline

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

I don't know, since I only reported it from the support desk (and I'm not able to test on windows servers). The bug is very old and had no further activity... Maybe we should close it.

Thanks for the quick answer! Let's do that, could be reopened if still happening / happening again.