我有这些设置:
CustomHttpHandlers = {
{HttpStatusCode.NotFound, new RazorHandler("/notfound")},
{HttpStatusCode.Unauthorized, new RazorHandler("/unauthorized")},
}
当我访问/stars
不存在的文件夹中的内容时:
/stars/asdf/xyz
它首先检查/stars/asdf/default.cshtml
. 然后转到stars/default.cshtml
并加载具有default
页面的任何级别。因此,只有当/stars
根文件夹根本不存在时,/notfound
才会被加载。
是否可以要求它在不存在/notfound
时加载?/asdf/xyz
这是根目录下的行为:
http://localhost:2000/asdf
会带你去/notfound
。但是,它不会在文件夹下这样做。
给你。
编辑 - - - - - - - - - - - - - - - - - - - - - - - - - -----
我实际上注意到,如果我转到没有默认值但实际上存在 root 的错误 url,在这种情况下,两个/stars/asdf
- >都会一个接一个地加载?!?/stars
/default.cshtml
/notfound
/default
我的设置有问题吗?SS出问题了?