More in this section
Forums / Deployment / Custo404Redirect Error iis8

Custo404Redirect Error iis8

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
3 posts, 0 answered
  1. Ajay
    Ajay avatar
    46 posts
    14 Nov 2013
    05 Mar 2014
    Link to this post


    Custom404 Redirecting is Successfully Redirecting in local system, But its not Working in Server(windows server 2012, IIS8),

    Here is my code:

    <customErrors mode="On" defaultRedirect="~/not-found">
    <error statusCode="404" redirect="~/custom404" />
    <error redirect="~/not-found" statusCode="403"/>

    Please help me how to Solve this,Here I'm Attaching Error Screen Shot,

    Thanks & Advance


  2. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    17 Aug 2017
    07 Mar 2014
    Link to this post
    Hello Ajay,

    The <customErrors> section handles only the ASP.NET errors. When you host your site on IIS you also need to configure the IIS to return your custom error pages whenever it encounters an http error on your site.

    In order to configure the IIS error handling you need to add the following code under the <system.webServer> section in the web.config file:

    <urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="false"/>     
        <httpErrors errorMode="Custom" defaultResponseMode="ExecuteURL">
          <remove statusCode="404" />
          <error statusCode="404" path="/custom404" responseMode="Redirect" />

    You can also take a look at the following article for additional information on http errors.

    Sabrie Nedzhip
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
  3. Jeremy
    Jeremy avatar
    33 posts
    22 Apr 2010
    03 Sep 2014 in reply to Sabrie Nedzhip
    Link to this post

    I am having a similar issue with the custom error pages. I can get them to redirect, but how do I get them to return a 404 status code? Right now the page is returning a 200 status code with the bad urls. 

    <customErrors mode="RemoteOnly" defaultRedirect="~/error/generic.aspx">
            <error statusCode="403" redirect="~/error/403.aspx" />
            <error statusCode="404" redirect="~/error/404.aspx" />
              <error statusCode="500" redirect="~/error/500.aspx" />
    <httpErrors errorMode="Custom" defaultResponseMode="ExecuteURL">
                <remove statusCode="404" />
                <error statusCode="404" path="/error/404.aspx" responseMode="ExecuteURL" />

3 posts, 0 answered