Page Not Found

  0 rating
3/22/2013 3:26:50 AM
4/17/2015 1:40:18 PM
Provider: Sitecore

About

You can use the PageNotFound httpRequestBegin pipeline processors to:

    * Apply different 404 pages for different Web sites (NotFoundSiteResolver).
    * Redirect to a search page using the path in the attempted URL as the search query (NotFoundSearchResolver).
    * Redirect the browser to an alternate page, such as when updating URLs (NotFoundRedirector).
    * Log 404 requests, including the referring page when possible (NotFoundLogger). 



Last documented compile: Sitecore 6.0.1 090212 

Documentation

Documentation
  • Documentation > Getting Started with the Page Not Found
    Getting Started with the Page Not Found

     You can use the PageNotFound httpRequestBegin pipeline processors to:

        * Apply different 404 pages for different Web sites (NotFoundSiteResolver).
        * Redirect to a search page using the path in the attempted URL as the search query (NotFoundSearchResolver).
        * Redirect the browser to an alternate page, such as when updating URLs (NotFoundRedirector).
        * Log 404 requests, including the referring page when possible (NotFoundLogger).

    NOTE: This project relies on the Library component.

    PageNotFound httpRequestBegin Pipeline Processor Configuration

    Add the PageNotFound processors after the ItemResolver in the httpRequestBegin pipeline defined in web.config:

    <processor type="Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel" />
    <processor type="Sitecore.Sharedsource.Pipelines.HttpRequest.NotFoundRedirector, Assembly" />
    <processor type="Sitecore.Sharedsource.Pipelines.HttpRequest.NotFoundLogger, Assembly" />
    <processor type="Sitecore.Sharedsource.Pipelines.HttpRequest.NotFoundSearchResolver, Assembly" />
    <processor type="Sitecore.Sharedsource.Pipelines.HttpRequest.NotFoundSiteResolver, Assembly" />

    Comment or remove any processors that you do not wish to use.

    NotFoundRedirector

    The NotFoundRedirector redirects the user agent to the URL specified by the "to" attribute of the /redirects/redirect element in the /app_data/redirects.xml file with a "from" attribute matching the path in the requested URL f the "to" path does not correspond to an item within the context site. For example, given the following /app_data/redirects.xml, if the user agent requests /old.aspx, the NotFoundRedirector will redirect the user agent to the URL of the /new item if it exists within the context site, or the URL /new if that item does not exist:

    <redirects>
      <redirect from="/old.aspx" to="/new" />
      <redirect from="..." to="..." />
    </redirects>

    Alternatively, the "to" attribute can specify the full path to an item or an arbitrary URL.

    NotFoundLogger

    The NotFoundLogger logs the URL that triggered the HTTP 404 Page Not Found condition, including the referrer when possible (the page containing the broken link).

    NotFoundSearchResolver

    If the start item for the context site has a child named Search, the NotFoundSearchResolver sets the context item to that search item and rewrites the URL, passing the requested path as the query string parameter named q.

    NotFoundSiteResolver

    The NotFoundSiteResolver sets the context item to the item identified by the notFound attribute of the logical site definition, supporting different 404 pages for different logical sites. Set the notFound attribute of each of the /configuration/sitecore/sites/site elements in web.config to the path to an item relative to the start path of that site. For example, to set the notFound item for the default published site to /Sitecore/Content/Home/Errors/NotFound?, add the notFound attribute to the appropriate <site> element in web.config:

    <site name="website" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content" startItem="/home" notFound="/errors/notfound" ...

    0
Back
Release notes
The module was added 06-03-2009
Read more Back
Code examples

Solution screenshots(0)

Upload

Reviews (0)

Sort by: Date Most votes
  • Profile Avatar
    [fullName]

    Level: 0

    x0 x0 x0

    [date]

    [title]

    [text]

    Was this helpful?

    0

Comments (0)

Sort by: Date  Most votes

Leave a Comment

Comment must be field in
Post comment
loader

Write a review

Title can't be empty
Review can't be empty
Post review

Download

Title Description Download Action

Add File