[英]IIS 8 Rewrite rule gives me 404 error
I used following Rewrite rule on IIS 8 for asp.net application. 我在IIS 8上针对asp.net应用程序使用了以下重写规则。 But it gives me 404 error when I try to access www.mysiteurl.com/?_escaped_fragment_.
但是当我尝试访问www.mysiteurl.com/?_escaped_fragment_时,它给我404错误。 If I change actionType to Redirect it redirect successfully.
如果我将actionType更改为Redirect,它将成功重定向。
<rule name="Prerender" stopProcessing="true">
<match url="^(?!.*?(\.js|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.gif|\.woff|\.woff2|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.doc|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent))(.*)" ignoreCase="false" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_USER_AGENT}" pattern="baiduspider|facebookexternalhit|twitterbot" />
<add input="{QUERY_STRING}" pattern="_escaped_fragment_" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="http://service.prerender.io/http://{HTTP_HOST}/{R:0}" />
</rule>
But If I set action URL to resource inside the same server it works. 但是,如果我将操作URL设置为同一服务器内的资源,则它可以工作。 As I feel the issue happens because it redirect to another domain.
据我所知,问题发生是因为它重定向到另一个域。
Are there any specific setting on IIS to enable diferent domain Rewrite? IIS上是否有任何特定设置可启用不同的域重写? What could be the problem ?
可能是什么问题呢 ?
After doing research I found out the solution for this. 经过研究,我找到了解决方案。 Installing Application Request Routing to the IIS and enable proxy solved my problem.
安装到IIS的应用程序请求路由并启用代理解决了我的问题。
Hope this would help to some one :) 希望这对某些人有帮助:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.