asp.net - invalid or unknown .aspx pages do not trigger 404, and instead display marker file text -


on web server, if visit page not exist, generates proper 404, unless page ends in .aspx. if invalid url ends .aspx, iis generates marker file error:

"this marker file generated precompilation tool, , should not deleted!"

instead of proper 404. how can make iis display/serve 404 unknown or invalid .aspx pages?

for example:

http://www.mysite.com/idontexist.txt --> generates proper 404 http://www.mysite.com/idontexist.aspx --> marker file error instead of 404

any ideas?

you need turn on custome errors via web.config

 <configuration>   <system.web>     <customerrors defaultredirect="genericerror.html" mode="on">       <error statuscode="404" redirect="pagenotfound.html"/>     </customerrors>   </system.web> </configuration> 

more information on can found in msdn


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -