Apache2 decodes incoming URI paths before sending them to PHP. This worked well in a world where 99.9% of requests would get rewritten into index.php?... form, but having MW sit behind it now that the REST API is on the horizon poses a problem, since REST API paths get matched using those same forward slashes. For example, the URI /w/rest.php/en.wikipedia.beta.wmflabs.org/v3/page/pagebundle/User%3APchelolo%2FOnDemand_Test/275844 gets passed to PHP as /w/rest.php/en.wikipedia.beta.wmflabs.org/v3/page/pagebundle/User:Pchelolo/OnDemand_Test/275844 which then cannot be matched by MW's REST router since the route definition is /w/rest.php/{domain}/v3/page/{format}/{title}/{revision}. Therefore, for the needs of the REST API, all of the path parameters that could contain slashes should be encoded.
Since the decoding is still needed for all non-REST routes, the question is: can we have the decoding not done only for them? If not, what are some alternatives that can be explored?
Originally reported as T235375: Parsoid/PHP responds with 404 for titles with slashes and revision, see there for more (detailed) info.