1

I have issue/concern where Sitecore is not returning a 404 response when the url contains the display name of the item.

e.g.

I have page called destination as a item name and display name as where, so when I browse /where its displays the /destination page instead of giving 404.

I have already set the link manager config to useDisplayNames=false

2
  • Hi Uday, can you check the useDisplayName setting in LinkManager? Is it set to true by any chance? You can check it via https://[instanceName]/sitecore/admin/showconfig.aspx Oct 28 '19 at 15:24
  • @SumitUpadhyay its already set to false. Oct 28 '19 at 16:24
4

This is how Sitecore works with item resolving. It will resolve via Item Name or Display Name. Setting the useDisplayNames in the LinkProvider will have zero effect on how Sitecore resolves the item names.

In the ItemResolver the code calls tries to resolve the item by the Item Name first, then if it can't do that it calls this method:

this.ResolveUsingDisplayName(args);

Which will resolve using the display name. The only way to change that would be to roll your own ItemResolver and patch that in, instead of the default one. Then you could remove the extra call to this.ResolveUsingDisplayName(args); and let the Item resolution fail which would give the page not found error.

Alternative Option

If you are worried about this because of SEO dilution, you can simply make sure that each page as a Canonical Url meta tag set to the url created via the item name. This would make sure that any search engines see both urls as the same page and the SEO importance would not be diluted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.