如何在IIS7中伪造404
我想将 /directory/default.aspx 设置为返回 404,即使文件和文件夹存在。在 IIS7 设置中如何做到这一点?
更新:我想在 IIS 管理器中执行此操作,而不是在代码上执行此操作。
I would like to set /directory/default.aspx to return 404 even though file and folder exist. How is this possible to do in IIS7 settings?
Update: I would like to do this in IIS Manager, not on code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,没有用于此目的的 IIS 设置。
As far as I know, there is no IIS setting for this purpose.
您可以尝试在 default.aspx 中抛出异常:
You can try throwing an exception inside of your default.aspx: