URLRewriteFilter - 将子域指向子文件夹

时间:2013-05-03 13:00:59

标签: java subdomain tuckey-urlrewrite-filter

目前,我的所有域请求都使用以下URLRewrite规则定向到www:

 <rule>
        <name>Canonical Redirect</name>
        <condition name="host" operator="notequal">^test.com</condition>
        <condition name="host" operator="notequal">^$</condition>
        <from>^/(.*)</from>
        <to type="permanent-redirect" last="true">http://www.test.com/$1</to>
    </rule>

我有2个要求:

  1. 我有一个域名child.test.com - 我不希望这个域名指向www.test.com
  2. 我需要这个child.test.com指向一个子文件夹而不在浏览器URL中显示: 即键入child.test.com实际上应该在后端调用test.com/child而不更改浏览器中的URL。
  3. 我相信我可以使用以下代码,但似乎我错过了一些东西。谢谢你的帮助!

    <rule name="RedirectTo" stopProcessing="true">
           <match url="http://child.test.com" />
           <action type="Redirect" url="http://test.com/child" />
     </rule>
    

0 个答案:

没有答案