2011-10-02 5 views
6

私のurlrewritesに問題があります - 書き換えられるページを指しているときはいつでも、それはCSSの& jsファイルにもルールを適用しているため表示できません私のウェブページ内で参照されます。IISのURLリライト - cssとjsが間違って書き換えられます

これを解決するには、CSSとjsの完全修飾パスを入れてください。ブラウザがハングした書き換えページにアクセスしようとすると、書き換えが適用されていないページでレンダリングがうまくいきます。

誰かに似たようなものがありましたか?その場合は解決策がありますか?助けをお待ちしています。似たような問題でサイトを見てみましたが、これまで何も助けてくれませんでした。私のWebページ内の

<rewrite> 
<outboundRules> 
<rule name="OutboundRewriteUserFriendlyURL1" preCondition="ResponseIsHtml1" stopProcessing="true"> 
<match filterByTags="A, Form, Img" pattern="^(.*/)myapplicationname/Index\.html\?team=([^=&amp;]+)$" /> 
<action type="Rewrite" value="{R:1}team/{R:2}/" /> 
</rule> 
<preConditions> 
<preCondition name="ResponseIsHtml1"> 
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /> 
</preCondition> 
</preConditions> 
</outboundRules> 
<rules> 
<rule name="RedirectUserFriendlyURL1" stopProcessing="true"> 
<match url="^myapplicationname/Index\.html$" /> 
<conditions> 
<add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" /> 
<add input="{QUERY_STRING}" pattern="^([^=&amp;]+)=([^=&amp;]+)$" /> 
</conditions> 
<action type="Redirect" url="{C:1}/{C:2}" appendQueryString="false" /> 
</rule> 
<rule name="RewriteUserFriendlyURL1" stopProcessing="true"> 
<match url="^([^/]+)/([^/]+)/?$" /> 
<conditions> 
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
</conditions> 
<action type="Rewrite" url="Index.html?{R:1}={R:2}" appendQueryString="false" /> 
</rule> 
</rules> 
</rewrite> 

<script src="/myapplicationname/Scripts/jquery-1.4.1.js" type="text/javascript"> </script> 
<link href="/myapplicationname/Styles/MainStyle.css" rel="stylesheet" type="text/css" /> 

が、それはこれらの書き換えを適用し、/myapplicationname/Team/Styles/MainStyle.cssを見つけようとJSファイルと類似しています。

答えて

4

問題を引き起こしているルールを1つずつ削除してみてください。今、そのルールに条件を追加します。

<rule name="Some rule"> 
     ... 
     <conditions logicalGrouping="MatchAny"> 
      <add input="{URL}" pattern="^.*\.(ashx|axd|css|gif|png|jpg|jpeg|js|flv|f4v)$" negate="true" /> 
     </conditions> 
    </rule> 

これなどの.js、.cssので終わるファイル上のルール、

を実行しないようになります
関連する問題