IIS6 svr2003 から IIS7.5 サーバー 2008r2 に移行し、URL 書き換えをインストールしました。それはすべてうまくいきます。問題の Web サイトは大規模で、.net 2 統合パイプラインで実行されています。現時点では、.net 4 でやり直すことはできません。私はこれにまったく慣れておらず、ここでの私の深さから少し外れています。書き換え機能を使いたいのですが、サブアプリも動作させる必要があります。どんな助けでも大歓迎です。
ただし、外部ベンダーのサブ仮想アプリには、webconfig の書き換えセクションに問題があります。コメントアウトすると、サブ仮想がうまく機能します。私はウェブを見て、いくつかのことを試しました:
<location path="." inheritInChildApplications="false">
また
<location path="." allowOverride="true" />
書き換えモジュールをラップすると、次のようになります。system.web要素には無効な子要素の場所があります。
サブ仮想アプリの webconfig の system.web のすぐ下で試しましたが、書き換えがコメントアウトされていても、エラーが発生します。私は削除を試みることができましたが、誰かがこの問題について私に洞察を与えることができるかどうか疑問に思いました.
基本的な書き直しは次のとおりです。
<rewrite>
<rules>
<rule name="RedirectUserFriendlyURL1" stopProcessing="true">
<match url="^sethsBrochure.pdf$" />
<conditions>
<add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
</conditions>
<action type="Redirect" url="path/path/doc.pdf" appendQueryString="false" />
</rule>
<rule name="RewriteUserFriendlyURL1" stopProcessing="true">
<match url="^sethsBrochure$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="path/path/doc.pdf" />
</rule>
</rules>
<outboundRules>
<rule name="OutboundRewriteUserFriendlyURL1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^(.*)path/path/doc\.pdf$" />
<action type="Rewrite" value="{R:1}/ path/path/doc" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>