开发者

How to fake 404 in IIS7

开发者 https://www.devze.com 2023-01-01 09:14 出处:网络
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?

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

精彩评论

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

关注公众号