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?
Sitecore Stack Exchange is a question and answer site for developers and end users of the Sitecore CMS and multichannel marketing software. It only takes a minute to sign up.
Sign up to join this communityWe 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?
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.
You can follow the below steps to test this scenario :-
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.
LinkItemNotFoundUrl
setting will call and will open /sitecore/service/notfound.aspx
page.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-