参考了一位大侠的办法:http://www.cnblogs.com/dragonstreak_1/archive/2011/03/18/1988212.html
按照上述情况,能实现二级域名重写,但在运行过程中,其他伪静态却失效了。于是乎多加了个urlwrite节点,这样就正常了,为了简洁,省略了不相关的内容
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
<section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>
</configSections>
<RewriterConfig>
<Rules>
<!--MarketShopDetail.aspx?MarketID=$1-->
<RewriterRule>
<LookFor>http://([A-Za-z0-9-]*[^www]).xxxxx.com/</LookFor>
<SendTo>~/MarketDetail.aspx?UName=$1</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<rewriter>
<!--OK start-->
<rewrite url="~/company/news/([A-Za-z0-9-]*).html$" to="~/DesignerNewsDetail.aspx?NewsID=$1" processing="stop"/>
<rewrite url="~/search.html" to="~/Search.aspx" processing="stop"/>
<rewrite url="~/websearch.html" to="~/MyWebSearch.aspx" processing="stop"/>
<rewrite url="~/build/company/product/([A-Za-z0-9-]*).html$" to="~/BuildCompanyProductDetail.aspx?ProductID=$1" processing="stop"/>
<rewrite url="~/build/picbuild/([A-Za-z0-9-]*).html$" to="~/BuildSeePicSayBuild.aspx?PageIndex=$1" processing="stop"/>
<rewrite url="~/market/news/list.html" to="~/MarketNewsList.aspx" processing="stop"/>
<rewrite url="~/register.html" to="~/Register.aspx" processing="stop"/>
</rewriter>
<httpModules>
<add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter"/>
<add type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" name="UrlRewriter"/>
</httpModules>
还有一个值得注意的地方是避免重复添加映射:应用程序扩展和通配符应用程序映射如图,不要同时添加,我这里实现二级域名重写,仅在下面添加通配符应用即可