20-11-2012Door Ruud van Falier
When Sitecore can't find the requested item, it will redirect the user to the page that is configured in the setting ItemNotFoundUrl. The problem is that redirecting will return an HTTP status code 302 (Moved Temporarily) and what we really want is the status code 404 (Not Found).
I've seen solutions where people will set the status code on the 'ItemNotFound' page. That does not solve anything because the client will still be redirected to the ItemNotFound page and the initial request will not be marked as not found.
To solve this problem you can implement this custom pipeline processor.
19-10-2012Door Ruud van Falier
In Sitecore you have the ability to add sublayouts (also known as components) to placeholders on your page. Sublayouts can point to a datasource item that is used as (you've guessed it) data source during rendering of the sublayout.
There are a few ways to do this, generally by:
- Presetting the sublayout on a placeholder through the page template's Standard Values
- Use the Page Editor to add the sublayout to a placeholder after the page item has been created.
Both methods have a flaw that I wanted to eliminate and this blog post describes those flaws and the methods I used to get rid of them.