Quantcast
Channel: URL Rewrite Module
Viewing all articles
Browse latest Browse all 2482

URL Rewrite Module decodes UTF-8 encoded querystring as if it were iso-8859-1

$
0
0

I'm about to move a multisite Wordpress site from Linux and nginx to IIS. I've set up a server with Windows 2012 R2. The problem is that the site users have used non-ascii characters in media file names. Everything is in UTF-8, database, php-files, etc. All files have been moved with preserved filenames, etc. What happens is that when the rule for fetching media files are matched, the rewrite engine changes the file name with non-ascii characters in. I have a failed request trace below that shows what is happening:

33. Rule match, look at the URL!

34. Querystring is URL-encoded. All non-ascii characters are encoded as if they were UTF-8 (correctly)

35-37. The child request is made, but with the wrong characters. If you take the quesystring from step 34 and treat it as iso-8859-1, you get this result when you url-decode it. This request fails, since there are no file named like that.

What should I change and where? In my opinion the URL Rewrite Module makes a mistake here, but how can I tell how to behave?

33. -REWRITE_ACTION

<div id="section_detail_33_details">
Substitutionwp-includes/ms-files.php?file={R:2}
RewriteURL/wp-includes/ms-files.php?file=2013/12/Grävling_mårdfällor.jpg
AppendQueryStringfalse
LogRewrittenURLfalse
</div>
<div class="duration">0 ms</div> <div class="severity-verbose">Verbose</div>34. -RULE_EVALUATION_END<div id="section_detail_34_details">
RuleNameImported Rule 2
RequestURLwp-includes/ms-files.php
QueryString?file=2013/12/Gr%C3%A4vling_m%C3%A5rdf%C3%A4llor.jpg
StopProcessingtrue
Succeededtrue
</div>
<div class="duration">0 ms</div> <div class="severity-informational">Informational</div>35. -URL_REWRITE_END<div id="section_detail_35_details">
RequestURL/wp-includes/ms-files.php
</div>
<div class="duration">0 ms</div>36. -GENERAL_CHILD_REQUEST_START<div id="section_detail_36_details">
SiteId4
RequestURLhttp://krets.jagareforbundet.se:80/wp-includes/ms-files.php?file=2013/12/Grävling_mårdfällor.jpg
RequestVerbGET
RecursiveLevel1
</div>
<div class="duration">0 ms</div>37. -GENERAL_REQUEST_START<div id="section_detail_37_details">
SiteId4
AppPoolIdkrets.jagareforbundet.se
ConnId1610612783
RawConnId0
RequestURLhttp://krets.jagareforbundet.se:80/wp-includes/ms-files.php?file=2013/12/Grävling_mårdfällor.jpg
RequestVerbGET
</div>

Viewing all articles
Browse latest Browse all 2482

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>