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

URL重写 放在II7 下之后 CSS和JS不能用了
本帖最后由 Ray_Yang 于 2010-11-03 20:14:27 编辑
本来是II6下正常的
现在放在II7下
就提示 
“/”应用程序中的服务器错误。
未能执行 URL。 
CSS和JS不能执行了。
该怎么弄比较好 让CSS 和js啊 不交给URLRewriter处理

<RewriterConfig>
    <Rules>
     <RewriterRule>
        <LookFor>~/login</LookFor>
        <SendTo>~/admin.aspx</SendTo>
      </RewriterRule>
      <!--<RewriterRule>
        <LookFor>~/index</LookFor>
        <SendTo>~/index.aspx</SendTo>
      </RewriterRule>-->
    
      <RewriterRule>
        <LookFor>~/reg</LookFor>
        <SendTo>~/reg.aspx</SendTo>
      </RewriterRule>
 
      <RewriterRule>
        <LookFor>~/t/(.+)</LookFor>
        <SendTo>~/ArticleDetail.aspx?OrderIndex=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/tag/(.+)</LookFor>
        <SendTo>~/TageDetail.aspx?Tag=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/aboutme</LookFor>
        <SendTo>~/aboutme.aspx</SendTo>
      </RewriterRule> 
  
    </Rules>
  </RewriterConfig>


    <httpHandlers>
      
      
      <add verb="*" path="/t/*" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
      <add verb="*" path="/tag/*" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
        <add verb="*" path="/login" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
 
    </httpHandlers>


------解决方案--------------------
iis7下面加一个

<Handlers>
      
      
      <add verb="*" path="/t/*" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
      <add verb="*" path="/tag/*" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
        <add verb="*" path="/login" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
 
    </Handlers&g