asp.net custom error page and file without extension

青春壹個敷衍的年華 提交于 2020-01-05 08:32:19

问题


How can i get IIS 7 to return my custom error pages for file without extension? I got it working for file with extension, but when the extension is not specified, i get the generic page.


回答1:


Try adding a wildcard application extension that maps to the aspnet_isapi.dll.

Without that mapping, requests will never hit the aspnet dll for processing and the default IIS 404 page will be returned.




回答2:


Well if you are dealing with such a situation you should handle these no extension files and then redirect to your custom error page.




回答3:


IIS 7 supports extension less URLs, you can use this with combination of Urlrewriting.net

here is very good article about achieving what you want.

http://www.vinodunny.com/blog/post/ASPNET-Extensionless-URL-ReWriting-in-IIS-7.aspx



来源:https://stackoverflow.com/questions/815692/asp-net-custom-error-page-and-file-without-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!