Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Url 强制Sitecore处理对文件(.*)的任何请求_Url_Iis_Request_Rewrite_Sitecore - Fatal编程技术网

Url 强制Sitecore处理对文件(.*)的任何请求

Url 强制Sitecore处理对文件(.*)的任何请求,url,iis,request,rewrite,sitecore,Url,Iis,Request,Rewrite,Sitecore,如何才能强制Sitecore处理任何文件请求,而不是从IIS获得404。 原因是,我们希望能够将URL重写模块()也应用于文件请求 例如: 用户请求:(哪个文件存在) 但是,我们不希望获取IIS“HTTP错误404.0-通过StaticFile找不到”,而是希望Sitecore获取请求,并应用任何重写规则(如果可用),否则使用Sitecore notfound页面 我尝试向system.webserver添加不同的处理程序,但没有成功,也尝试直接修改IIS设置上的处理程序映射。我不确定您是否应该

如何才能强制Sitecore处理任何文件请求,而不是从IIS获得404。 原因是,我们希望能够将URL重写模块()也应用于文件请求

例如: 用户请求:(哪个文件存在)

但是,我们不希望获取IIS“HTTP错误404.0-通过StaticFile找不到”,而是希望Sitecore获取请求,并应用任何重写规则(如果可用),否则使用Sitecore notfound页面


我尝试向system.webserver添加不同的处理程序,但没有成功,也尝试直接修改IIS设置上的处理程序映射。

我不确定您是否应该转到那里,因为所有请求都将通过Sitecore,但如果您需要,可以更改此配置:

<preprocessRequest>
  <processor type="Sitecore.Pipelines.PreprocessRequest.FilterUrlExtensions, Sitecore.Kernel">
    <param desc="Allowed extensions (comma separated)">aspx</param>
    <param desc="Blocked extensions (comma separated)">*</param>
    <param desc="Blocked extensions that stream files (comma separated)">css,js</param>
    <param desc="Blocked extensions that do not stream files (comma separated)">*</param>
  </processor>
</preprocessRequest>
我认为这是URL重写器模块处理请求所需的唯一内容。

请记住,该模块处理的文件请求未经测试且不受支持,但理论上它应该可以工作。

我不确定您是否应该去那里,因为所有请求都将通过Sitecore,但如果您需要,可以更改此配置:

<preprocessRequest>
  <processor type="Sitecore.Pipelines.PreprocessRequest.FilterUrlExtensions, Sitecore.Kernel">
    <param desc="Allowed extensions (comma separated)">aspx</param>
    <param desc="Blocked extensions (comma separated)">*</param>
    <param desc="Blocked extensions that stream files (comma separated)">css,js</param>
    <param desc="Blocked extensions that do not stream files (comma separated)">*</param>
  </processor>
</preprocessRequest>
我认为这是URL重写器模块处理请求所需的唯一内容。

请记住,该模块处理文件请求时未经测试且不受支持,但从理论上讲它应该可以工作。

它不仅在理论上可以工作,而且在实践中也可以工作!谢谢你的建议,它现在被标记为可行的解决方案,谢谢。作为旁注,我尝试使用Sitecore 8使用
*
允许扩展并清除阻止的扩展,这打破了体验编辑器。它不仅在理论上可行,而且在实践中也可行!谢谢你的建议,它现在被标记为可行的解决方案,谢谢。作为旁注,我尝试使用
*
作为允许的扩展,并使用Sitecore 8清除阻止的扩展,这打破了体验编辑器。