Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.

Answered Handle 404 error on SP2010 sub site

All Replies

  • Saturday, March 03, 2012 3:10 AM
     
     

    This can be achieved using a custom HTTP Module.


    Ram Prasad Meenavalli | MCTS SharePoint 2010 | MCPD SharePoint 2010

  • Saturday, March 03, 2012 7:58 PM
     
     

    Yes, http module was the option I had. But just wanted to explore if there was an option at IIS 7.0 level.

    Thank you very much for your reply Ram.

    Cheers.


  • Sunday, March 04, 2012 2:53 PM
     
     Answered Has Code

    I assume handling of 404 error to redirect to a custom page at the IIS 7.0 Custom errors 404  are  using  .htm .html pages.

    Your using ASP.Net for the page-not-found.aspx.

    "Sharepoint Custom error Pages"  Forums http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/56bdbadc-e6bc-492d-9311-ca68f414dd8e/

    This has to be inserted in web.config.  The page-not-found.aspx the .net Framework version and mode needs to set correctly.

    <configuration> 
    <system.web> 
     <customErrors defaultRedirect="/404.aspx" mode="On"> 
       <error statusCode="404" redirect="/my404error.aspx" /> 
       <error statusCode="500" redirect="/my500error.aspx" /> 
       </customErrors> 
     </system.web>
    </configuration>
    
    Martin

    Martin Rasch

    • Marked As Answer by Pengyu Zhao Monday, March 12, 2012 3:54 AM
    •