【发布时间】:2012-03-09 10:17:54
【问题描述】:
问题 当我尝试使用 cshtml 扩展访问我的 ASP.NET Web Page 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 扩展,页面可以正常工作。
有谁知道如何解决这个问题?
【问题讨论】:
标签: asp.net wordpress razor url-rewrite-module