[ASP.NET] webResource.axd 403 エラー

ASP.NET

概要

WEBサイトをリニューアルしたら・・・
Treeview で 画像を使用している部分が表示されなくなった
調べたら、webResource.axd ?xxxxxxxxxx  にて、403 エラー

原因は?

上位にある web.config で記述されている URL書き換えルールが影響していた

例えば…トップレベルに wordpress を配置し、仮想ディレクトリで asp.net アプリケーションを配置していたが wordpress で使用している web.config にて あらゆる URLの書き変え動作がなされていた。

<rule name="WordPress: http://xxxxxxxxx" patternSyntax="Wildcard">
   <match url="*" />
       <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
          <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
       </conditions>
   <action type="Rewrite" url="index.php" />
</rule>

回避させるために、”特定のディレクトリについてはルールから省く”をいれる

    <rewrite>
      <rules>
                <clear />
                <rule name="freeship" stopProcessing="true">
                    <match url="^ここにフォルダ名/.*" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="None" />
                </rule>
                <rule name="WordPress: http://xxxxxxxxx" patternSyntax="Wildcard">
                    <match url="*" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule></rules>
    </rewrite>

コメント

スポンサーリンク
タイトルとURLをコピーしました