IIS 7

编程入门 行业动态 更新时间:2024-10-22 03:05:31
本文介绍了IIS 7-不会触发重写规则,但可以与重定向一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在IIS 7上设置了以下重写规则:

I have the following rewrite rule set up on IIS 7:

<rule name="Rewrite /publicfiles/GUID/file.ext" stopProcessing="true"> <match url="^/?publicfiles/(.*)/(.*)" /> <action type="Rewrite" url="www.domain.tld" appendQueryString="false" / </rule>

当我尝试时,它似乎没有触发.我收到404错误,但如果将类型更改为重定向",则会触发并将我发送到指定的URL.有人可以对此有所启发吗?

When I try it out it appears to not fire. I get a 404 error, but if I change the type to Redirect it fires and sends me to the URL specified. Is someone able to shed some light on this?

我将规则的定义添加到了IIS服务器而不是站点的web.config中,然后运行良好.但是,这不太可行,因为我需要为各个站点配置规则.有什么想法吗?

I added the definition of the rule to the web.config of my IIS server rather than my site and then it worked perfectly. However this is not very feasible as I need to configure the rule for individual sites. Any ideas?

推荐答案

毕竟与全局规则无关.原来,我必须安装应用程序请求路由",然后才能使用站点规则:)

It wasn't about the global rule after all. It turned out I had to install Application Request Routing and then it worked with a site rule :)

更多推荐

IIS 7

本文发布于:2023-10-26 23:35:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1531668.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:IIS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!