問題 cshtml 拡張子を使用して ASP.NET Web ページ Razor ページにアクセスしようとすると、問題なく動作します。拡張機能を削除すると、WordPress はブログ投稿であるかのように URL を検索しようとし、ページにアクセスしたり、Razor 経由で「きれいな」URL を使用したりできません。
私は Winhost でホストしています。ルート アプリケーション ディレクトリに WordPress をインストールしました。そのディレクトリには、次の Web.cofig ファイルが含まれています。
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<add value="index.php"/>
</files>
</defaultDocument>
<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>
</configuration>
私のアプリケーションはサブフォルダー "/app" にあります。ここに移動して、自分で問題をテストできます。
http://www.cutrategamer.com/app/game-deals-chart.cshtml
次に、ここに行ってみてください:
http://www.cutrategamer.com/app/game-deals-chart/
ページは、ローカル マシンで cshtml 拡張機能がなくても正常に動作します。
これを解決する方法を知っている人はいますか?