【发布时间】:2017-01-02 22:48:19
【问题描述】:
我的 web.config 中有一个重写角色,它被重定向到 mydomain.com/de。
但现在我将用用户语言替换操作de/{R:1},我可以从{HTTP_ACCEPT_LANGUAGE} 获得。但这是一串语言,看起来像fr-CH,**fr**;q=0.8,en;q=0.6,de;q=0.4,de-CH;q=0.2/
那么有没有可能只取出这个字符串的**fr**?
感谢您的帮助。
这是我的角色:
<rule name="mydomain.com" stopProcessing="true" >
<match url="(.*)" />
<conditions>
<add input="{URL}" pattern="/en/|/de/" negate="true" />
</conditions>
<action type="Redirect" url="de/{R:1}" />
</rule>
【问题讨论】:
标签: asp.net asp.net-mvc iis url-rewriting asp.net-mvc-routing