We are trying to use display names for URLs and it doesn't work with JSS. E.g. we have a page "search" which has a display name in NL: zoeken.
- when I request
http://localhost:3000/en/search
, the JSS api call ishttp://local.sc/sitecore/api/layout/render/jss?item=%2Fsearch&sc_lang=en
(I've omitted api key), and it returns page data -> OK - when I request
http://localhost:3000/nl/zoeken
, the JSS api call ishttp://local.sc/sitecore/api/layout/render/jss?item=%2Fzoeken&sc_lang=nl
, and it returns 404 -> NOK
We use Sitecore 9.1 initial release. Looks like a bug, but can I maybe there's a workaround? Thanks in advance!
UPDATE Actually, the problem happens not only in connected mode but also in integrated.
E.g. if I request http://local.sc/nl/zoeken
- the page will be rendered, because in that case Item resolution pipeline runs and sets item correctly based on the display name.
However, if I request http://local.sc/en/search
and then using the language switcher will try to navigate to /nl/zoeken
, this will fail, because React router takes over the navigation and instead of requesting the whole page from the server, it only tries to retrieve /sitecore/api/layout/render/jss?item=%2Fzoeken&sc_lang=nl
which return 404.
Concluding the above, I think this is a bug in Sitecore, particularly in the item resolution pipeline of the Layout Service.