How to fake 404 in IIS7
I would like to set /directory/default.aspx to return 404 even though file and folder exist. How开发者_如何学C is this possible to do in IIS7 settings?
Update: I would like to do this in IIS Manager, not on code.
As far as I know, there is no IIS setting for this purpose.
You can try throwing an exception inside of your default.aspx:
throw new HttpException (404, "");
精彩评论