日期:2014-05-17  浏览次数:20511 次

万网M3型Windows主机实现二级域名绑定到子目录
这个主机支持伪静态,但是用web.config来伪静态的,
C# code
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite> 
            <rules>
                 <rule name="rule1" stopProcessing="true">
                     <match url="^article/([0-9]+)/([_0-9a-z-]+)" />
                     <action type="Rewrite" url="article.aspx?id={R:1}&amp;title={R:2}" />
                </rule>
                        <rule name="rule2" stopProcessing="true">
                    <match url="test.szfangwei.cn" />
                    <action type="Rewrite" url="/test/index.html"  />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>     
</configuration>



第一个同一个域名内伪静态可以
但是第二个我想二级域名test.szfangwei.cn指向到二级目录test/index.html 却不行
我知道可能是规则写错了,所以求救各位大侠

------解决方案--------------------
IIS不支持主机头泛域名绑定
 <RewriterRule>
<LookFor>http://(?!www\.)(\w+)\.website\.com/index.aspx[\w\W]{0,100}</LookFor>
<SendTo>~/Web/TEST/index.aspx</SendTo>
</RewriterRule>
------解决方案--------------------
不可以 绑定 虚拟目录的,