locked
Custom error page for 404 RRS feed

  • Question

  • I have implemented custom 404 page in my SharePoint 2010 environment to display custom message whenever user encountered any 404 error. I have added the below configuration in my application web.config file

    <httpErrors existingResponse="Replace" errorMode="Custom">
          <remove statusCode="404" subStatusCode="-1" />
          <error statusCode="404" prefixLanguageFilePath="" path="/custom/error404.html" responseMode="Redirect" />
    </httpErrors>

    The above redirection working fine without any issue, but I am getting different error while creating a new document directly (go to library->click on documents tab->click on new document). I am getting the below while saving the document directly in sharepoint application

    A device attached to the system is not functioning

    Please let me know if any one has got idea about this, how to avoid this error with custom 404 page implementation 

    Tuesday, January 12, 2016 6:38 AM

Answers

  • Hi Iftikar H,

    Yes, I have tried to create a new document, not upload or add a document. Here are my testing steps for your reference:

    1. Create a custom page called “error404” in Site Pages library in the root site.

    2. Browse to C:\inetpub\wwwroot\wss\VirtualDirectories and open the folder associated to the Sharepoint web application I would like to affect, backup the web.config file.

    3. Open IIS Manager, expand the desired the SharePoint we application, open Error Pages feature in the Features View.

    4. Edit the 404 path.

    5. Edit the web.config file and save the changes.

    6. Test the 404 error page. When the URL is wrong, the page will be redirected to the error404.aspx. It works.

    7. Go to a library in the site, click “New Document” to create a new document, then save this document.

    For this issue, please provide the detailed error message in ULS logs for further research.

    Best regards,

    Linda Zhang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by Victoria Xia Thursday, February 11, 2016 2:02 AM
    • Marked as answer by Victoria Xia Tuesday, February 16, 2016 7:23 AM
    Friday, January 15, 2016 9:52 AM

All replies

  • Hi

    check this solution

    https://sharepointankur.wordpress.com/2015/12/14/custom-404-page-not-found-error-page-in-sharepoint-2010/

    and check the code for web.config file


    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

    Tuesday, January 12, 2016 7:23 AM
  • I have done exactly same as I mentioned before the custom 404 is working fine, but getting other error while saving the document
    Tuesday, January 12, 2016 8:17 AM
  • Hi Iftikar H,

    I tried to reproduce this issue. I tested it with html/htm/aspx page. Created a custom error html/htm/aspx page, then specified the URL of 404 error page in IIS. Edited the web.config like yours and saved it.

    When testing with html/htm page, SharePoint cannot directly open this page in the browser. When customizing 404 error page with aspx page in Site Pages library of SharePoint, the custom 404 error page works fine. And the error does not shows up when I create a new document and save it.

    For troubleshooting this issue,  I need to confirm the following information:

    1. How many documents in this document library?

    2. Does this issue happens on all libraries in this web application?

    If you are using html page to custom the error page, please provide the detail steps about configuring the custom page for reproducing this issue.

    And It would be better if you can check if there are some relative error message in ULS log files, and provide the errors in the ULS log and the screenshot of the error dialog when saving the document directly in SharePoint for further research.

    Best regards,

    Linda Zhang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Thursday, January 14, 2016 3:15 AM
  • Can you please check the web.config file setting for 404 and also have you tried by creating the new document directly from sharepoint library (not upload or add document)
    Thursday, January 14, 2016 8:19 AM
  • Hi Iftikar H,

    Yes, I have tried to create a new document, not upload or add a document. Here are my testing steps for your reference:

    1. Create a custom page called “error404” in Site Pages library in the root site.

    2. Browse to C:\inetpub\wwwroot\wss\VirtualDirectories and open the folder associated to the Sharepoint web application I would like to affect, backup the web.config file.

    3. Open IIS Manager, expand the desired the SharePoint we application, open Error Pages feature in the Features View.

    4. Edit the 404 path.

    5. Edit the web.config file and save the changes.

    6. Test the 404 error page. When the URL is wrong, the page will be redirected to the error404.aspx. It works.

    7. Go to a library in the site, click “New Document” to create a new document, then save this document.

    For this issue, please provide the detailed error message in ULS logs for further research.

    Best regards,

    Linda Zhang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by Victoria Xia Thursday, February 11, 2016 2:02 AM
    • Marked as answer by Victoria Xia Tuesday, February 16, 2016 7:23 AM
    Friday, January 15, 2016 9:52 AM
  • Hi Iftikar H,

    Is there any update?

    Have you solved the issue?

    Best regards,

    Linda Zhang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Friday, January 22, 2016 2:29 AM