【发布时间】:2016-06-27 19:25:58
【问题描述】:
我有以下重写规则:
<rewrite>
<rules>
<rule name="FrontController" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="wcf/api.svc/auth/home" />
</rule>
</rules>
</rewrite>
这基本上将所有非文件 url 重写为 Web 服务 api 调用,该调用在 WCF 支持的 SPA 中返回 index.html。
上述重写最终包括原始 URL 中包含的所有查询字符串参数。我需要做的是将原始URL,例如'wcf/api.svc/auth/products'作为查询字符串参数包含在重写的URL中,例如'https://domain.com/wcf/api.svc/auth/products?enc=lkjewro8xlkz'被转换为'@987654322 @'。
这可能吗?如果可以,我需要做出哪些改变来实现它?我希望我的 WCF 应用程序知道原始 URL,以便它可以配置 SPA 以在加载时初始化为特定视图。
谢谢
【问题讨论】:
标签: wcf iis url-rewrite-module