I commented on another answer that the problem is that when resolving elements in the application, reverse replacements are applied. Since you have 2 replacements, like mapping to "-" and to incoming, this happens with an error, because it first tries to replace "-" with space, but some of these hyphens should be underlined, but have no idea which one it should be.
For example, this path: /path to some/item_url , then the generated URL is /path-to-some/item-url .
With an incoming response, they will answer back, and Sitecore will now look for /path to some/item url that does not exist and therefore is called 404. Since the "_" character (underscore) has been replaced with a "-" (hyphen), when you enter "- "(hyphen) is replaced by" "(space). Since there are no hyphens that can be replaced, it cannot replace the underscore.
Take a look at Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel and you will see a call to MainUtil.DecodeName(args.Url.ItemPath) , where EncodeNameReplacements are used.
It is better to use an event handler to deal with them in the first place, so you do not need to worry about any comparison.
jammykam
source share