404 error page customization in Web Apps (Windows)

尚典 青村 1 Reputation point

現在App Serviceを利用しており、エラーページ(404)をWebAppsの規定のコンテンツではなく、新規で作成したコンテンツを表示させたいと考えております。

I am currently using the App Service and would like to display the newly created content on the error page (404) instead of the specified content of WebApps.
Could you please tell me the location of the created 404 content and the settings for displaying the specified content?
Changed title from "Web Apps(Windows)での404エラーページカスタマイズ"
to " 404 error page customization in Web Apps (Windows)"

Adding English translation/ to receive insights from the community

404 error page customization in Web Apps (Windows)

Azure App Services
Azure App Services
A feature of Azure App Service used to create and deploy scalable, mission-critical web apps.
4,326 questions
{count} votes

2 answers

Sort by: Most helpful
  1. ajkuma 13,471 Reputation points Microsoft Employee

    @尚典 青村 , Thanks for the great question.

    As mentioned in the UserVoice “This is something we would like to bring in the future, but we cannot provide a timeline at this time.”-You may upvote the post.

    For customization, you may edit web.config file located in D:\home\site\wwwroot folder.

    You may try this code (copied below), answer from a similar SO discussion thread.
    For more details on customErrors flag.

    <?xml version="1.0" encoding="UTF-8"?>  
            <httpErrors errorMode="Custom" defaultResponseMode="ExecuteURL">  
                <remove statusCode="404" subStatusCode="-1" />  
                <error statusCode="404" path="/404.asp" responseMode="ExecuteURL" />  

    If your requirement fits, you may use Application Gateway, which allows you to create custom error pages instead of displaying default error pages. You can use your own branding and layout using a custom error page. Checkout this doc ‘custom error’ section for more details.

    No comments

  2. sadomovalex 3,591 Reputation points

    if you created web app using ASP.Net runtime stack than you may do that in the same way as for regular ASP.Net application: Implementing a Custom Error page on an ASP.Net website.

    No comments