开发者

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, "");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜