0

We have a setting under Sitecore.config file.

<setting name ="LinkItemNotFoundUrl" value ="/sitecore/service/notfound.aspx" />

Could someone assist me real time scenario when this setting will hit the page?

3 Answers 3

1

According to Sitecore documentation:

/// <summary>Gets the URL to redirect to, if an item is not found.</summary>
/// <value>Default value: "/sitecore/service/notfound.aspx"</value>
/// <remarks>
/// If a request for a non-existing item comes in on the
/// web site, the request is redirected to the url pointed to
/// by this setting.
/// </remarks>
public static string LinkItemNotFoundUrl => Settings.SettingsInstance.Core().LinkItemNotFoundUrl;

What is interesting though, looks like it's only used in obsolete DynamicLink class methods in Sitecore 10.X, so it looks like it should not be used at all in any new Sitecore implementations.

2
  • Do you have any example to test this as I am working on some scenario?
    – Nisha
    Jun 21 at 11:13
  • See updated answer. Jun 21 at 11:14
1

You can follow the below steps to test this scenario :-

  • Create two Sitecore items in Content Editor, one is Page 01 and second is Page 02. On Page 01 in the Content Editor add content in rich text field and create an anchor tag on Page 2 text for Page 02 item.

enter image description here

  • Now , open this page in Experience Editor. You can see the anchor tag on Page 2.

  • Delete Page 02 in Content Editor and it will open dialog box, select Leave links option.

enter image description here

  • When, you will open Page 01 in Experience editor and click on the link then LinkItemNotFoundUrl setting will call and will open /sitecore/service/notfound.aspx page.
0

As per my understanding here is the use of this field.

linkItemNotFoundUrl: The URL to redirect to if an item being linked to is not found.

Default value: if not specified, the value of the LinkItemNotFoundUrl setting in the <settings> section is used.

Initially, You don't need to extend the processor, there are settings in the Sitecore section of config to handle these. Update these values to point to the correct path. This can be a Sitecore item path, e.g. /errors/404 as long as that item exists in Sitecore.

Alternatively, You may need to create a processor that will handle this request. Use this article for more details on how to create a processor.

http://sitecoreblog.navavayas.com/Blog/35/Better-way-of-handling-sitecore-404-pages-

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.