1

私はaspxページの数を持っているサイトを持っています。

私は最近、ルートにワードプレスのブログを追加しました。

今、私は投稿のindex.phpを取り除くためにパーマリンクを変更しようとしています。

Rewrite 2.0、Fast CGI、PHP 5

このコードを追加しました。web.configファイルとwordpressは、かなりのパーマリンクで完全に機能しました。

<configuration>
<system.webServer>
    <rewrite>
        <rules>
            <rule name="wordpress" patternSyntax="Wildcard">
                <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.php" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>

これで、リライトも使用するaspxページの読み込みに失敗し、404が表示されます...上記のコードをweb.configから削除すると、aspxページはすべて問題ありません。

これを機能させる方法について何かアイデアを持っている人はいますか?

ありがとう

4

1 に答える 1

0

試してみることをお勧めします:

<system.webServer>
  <rewrite>
    <rules>
        <rule name="wordpress" patternSyntax="Wildcard">
            <match url="*.aspx" negate="true" />
                <conditions>
                    <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>
</system.webServer>

これにより、 .aspxリクエスト以外のすべてが index.php に送信されます。これは、ここで達成しようとしているものだと思います。主な変更点は次のとおりです。

match url="*.aspx" negate="true"

于 2012-12-07T11:15:43.443 に答える