【发布时间】:2011-08-25 23:00:20
【问题描述】:
我正在使用 web.config 中的 url 重写功能来重定向我的子域。这是我的规则:
<rule name="redirect_page">
<match url=".*" ignoreCase="false" negate="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\." negate="true" />
<add input="{HTTP_HOST}" pattern="^([\w\-]+)\.mySite\.com$" />
</conditions>
<action type="Rewrite" url="profile.aspx?name={C:1}" />
</rule>
这很好用: http://myUser.mySite.com 重定向到 http://myUser.mySite.com/profile.aspx?name=myUser
但是
http://myUser.mySite.com/image/myImage.jpg 重定向到 http://myUser.mySite.com/profile.aspx?name=myUser
=> 我想要什么: http://myUser.mySite.com/image/myImage.jpg 重定向到 http://myUser.mySite.com/image/myImage.jpg
有什么想法吗?
【问题讨论】: