ASP.NET/IIS: 404 for all file types

后端 未结 7 710
走了就别回头了
走了就别回头了 2020-12-20 21:51

I set up 404 handler page in web.config, but it works ONLY when extension of URL is .aspx (or other which is handled by ASP.NET). I know I can setup static HTML page in webs

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-20 22:49

    The web.config can only set up errors pages for pages controlled by it's web site. If you have any other pages outside the purview of the ASP.Net application, then you set up handling for them in IIS. There's an option in there for configuring the 404 page where you can point it to your custom page.

提交回复
热议问题