Can I set an image to be a 404 page for a specific folder in ASP.NET?
I have a folder on my webserver that contains images (filetype icons, actually). I would like 开发者_运维百科to serve a default image (default filetype icon) whenever a nonexistent file is requested. My idea was to set up the default icon as a custom 404 page. Can this be done?
Yes , put the config in that folder and provide appropriate entries in it.
<customErrors mode="RemoteOnly">
<error statusCode="404" redirect="/maintenance/Error404.html"/>
</customErrors>
Error404.html should contain that image. Another way to achieve the same is to write a custom module for that.
精彩评论