如何使用参数在asp.net中将URL重写为子域

时间:2014-10-06 15:21:13

标签: url rewrite

我使用重写网址2.0从abc.com/default.aspx?shop=123重写为123.abc.com

我的代码

<rewrite>
      <rules>
        <rule name="domain redirect" stopProcessing="true">
          <match url="^(.*)$" />
          <conditions trackAllCaptures="true">
            <add input="{HTTP_HOST}" pattern="^(.+)\.abc\.com$" />
          </conditions>
          <action type="Rewrite" url="{REQUEST_URI}?shop={C:1}" appendQueryString="true"/>
        </rule>
      </rules>
    </rewrite>

如何从

重写

abc.com/default.aspx?shop=123&title=456&id=789

123.abc.com/456/789.html

abc.com/view.aspx?shop=123&id=456

123.abc.com/view/456.html

0 个答案:

没有答案
相关问题