海风心情 发表于 2010-1-17 11:37:41

求高手帮忙把httpd.ini的正则转成web.config

换了万网的虚拟主机,之前的httpd.ini使用不了,需要转换成web.config才可以使用,我对正则不懂,希望有高手能帮忙转一下。
httpd.ini


# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32

#技术资料分页            
RewriteRule /article_(\d+)\.html /article\.html\?page=$1
#技术资料详细         
RewriteRule /articleshow_(\d+)\.html /news_show\.html\?id=$1
#工程案例分页            
RewriteRule /case_(\d+)\.html /case\.html\?page=$1
#工程案例分类            
RewriteRule /casetyle_(\d+)\.html /case\.html\?id=$1
#工程案例分类分页            
RewriteRule /casetyle_(\d+)\_(\d+)\.html /case\.html\?id=$1&page=$2
#工程案例详细         
RewriteRule /caseshow_(\d+)\.html /news_show\.html\?id=$1
#新闻分页            
RewriteRule /news_(\d+)\.html /news\.html\?page=$1
#新闻详细         
RewriteRule /newsshow_(\d+)\.html /news_show\.html\?id=$1
#产品         
RewriteRule /products_(\d+)\.html /products\.html\?page=$1
#产品详细         
RewriteRule /ProductShow_(\d+)\.html /Products_Show\.html\?id=$1
#产品大分类   
RewriteRule /Product_b(\d+)\.html /products_list\.asp\?bigclass=$1
#产品大分类分页   
RewriteRule /Product_b(\d+)_(\d+)\.html /products_list\.asp\?bigclass=$1&page=$2
#产品小分类      
RewriteRule /Product_s(\d+)\.html /products_list\.asp\?smallclass=$1    
#产品小分类 分页   
RewriteRule /Product_s(\d+)_(\d+)\.html /products_list\.asp\?smallclass=$1&page=$2
万网提供的web.config范例
<?xml version="1.0"?>
<configuration>
    <configSections>
      <section
            name="rewriter"
            type="HiChina.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, HiChina.UrlRewriter" />
    </configSections>
    <appSettings/>
    <connectionStrings/>
    <system.web>
      <httpModules>
            <add
                type="HiChina.UrlRewriter.RewriterHttpModule, HiChina.UrlRewriter"
                name="UrlRewriter" />
      </httpModules>   
    </system.web>
   
    <rewriter>
      <rewrite url="^(/.+(\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js)(\?.+)?)$" to="$1" processing="stop" />
      <rewrite url="~/lmh$" to="~/testurl/Users.aspx?user=lmh" processing="stop" />
      <rewrite url="~/tags/(.+)" to="~/testurl/tagcloud.aspx?tag=$1"processing="stop"/>
      <rewrite url="~/article-(.*)-(.*)-(.*).html"to="~/testurl/article.asp?id=$1&sid=$2&page=$3"processing="stop"/>
      <rewrite url="^~/mypage(\?.+)?$" to="~/index.htm$1" processing="stop" />
    </rewriter>   
</configuration>


有一个帖子说IIS7可以转换:http://www.cnblogs.com/lixyvip/archive/2009/03/02.html,我的电脑没装有这个工具,也没使用过,看不懂E文!
在这里,我先谢过各位朋友了!

stuv731 发表于 2010-1-17 23:52:56

页: [1]
查看完整版本: 求高手帮忙把httpd.ini的正则转成web.config