【发布时间】:2016-04-27 11:19:19
【问题描述】:
我在 WordPress 根文件夹中有静态 PHP 页面。在web.config 文件上,我将默认文件更改为静态PHP 文件home.php。我的网站有一些静态 PHP 页面和一些 WordPress 页面。对于 WordPress 页面,我使用永久链接更改了 SEO 友好 URL,但静态 PHP 页面无法删除 .php 扩展。
像这样:
http://reactore.com/contact-us/ --- WordPress 页面http://reactore.com/about-us.php --- 静态 PHP 页面
这是我的web.config 文件:
<rewrite>
<rules>
<rule name="WPurls" enabled="true" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
</rules>
</rewrite>
【问题讨论】:
标签: php html wordpress web content-management-system