+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Error 404 pages

Error 404 pages

2 posts, 0 answered
  1. Gooya
    Gooya avatar
    23 posts
    Registered:
    11 May 2010
    16 Oct 2013
    Link to this post
    Hello
    I'm using IIS6 and have sitefinity 6.1 site on it.
    When some user write fake path in url like /dsafsdafsdasdffsd , the iis throws iis exception Failed to Execute URL.
    So I wrote  function in global.asax that catches that error and redirects them to error page:
    void Application_Error(object sender, EventArgs e)
        {
            HttpContext.Current.ClearError();            
            Response.Redirect("~/en/page404");
        }

    That works for fake page like /dsafsdafsdasdffsd , but page /en/dfsdfdsddfasds show blank page with no content(not even html tags).
    I know upper exception is iis issue, but I think /en/dfsdfdsddfasds page is sitefnity issue. Is there any solution?
  2. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    07 Dec 2016
    21 Oct 2013
    Link to this post
    Hello,

    You need to add the following settings in your web.config file:
    <configuration>
      <system.web>
          <customErrors mode="On" defaultRedirect="/error-pages/default-error">
              <error statusCode="404" redirect="/en/page404.html" />
          </customErrors>
      </system.web>
    </configuration>

    <configuration>
       <system.webServer>
          <httpErrors errorMode="Custom" defaultResponseMode="File" existingResponse="Replace">
               <remove statusCode="404" subStatusCode="-1" />
               <error statusCode="404" path="/en/page404.html" responseMode="ExecuteURL" />
           </httpErrors>
       </system.webServer>
    </configuration>

    If a user enter an invalid address, he/she will be redirected to the page that you have point above.

    Let me know whether the proposed solution helps.

    Regards,
    Svetoslav Manchev
    Telerik
    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 Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered