【发布时间】:2012-10-31 01:07:28
【问题描述】:
我刚刚将我的永久链接从 /%postname%/ 更改为 /%postname%.html
因此,/%postname%/ 中的链接显示 404 错误。
我想将这些链接重定向到 /%postname%.html 以避免出现 404 错误页面。
【问题讨论】:
标签: wordpress redirect http-status-code-404 permalinks
我刚刚将我的永久链接从 /%postname%/ 更改为 /%postname%.html
因此,/%postname%/ 中的链接显示 404 错误。
我想将这些链接重定向到 /%postname%.html 以避免出现 404 错误页面。
【问题讨论】:
标签: wordpress redirect http-status-code-404 permalinks
使用扩展名更改永久链接设置只会在帖子中生效,而不是在页面中。在很多这样的情况下,我总是使用这个插件http://www.introsites.co.uk/wordpress/html-on-pages-plugin.html,它是一个简短的插件并且可编辑,您可以将扩展名(.html)更改为许多其他的,例如:.asp、.shtml 等。
但请注意:如果您对永久链接设置进行了编辑,请停用插件并在完成后再次激活它。因为如果您更改永久链接设置并且没有停用并激活此插件,所有页面将显示为未找到。
您可以查看插件统计信息http://wordpress.org/extend/plugins/html-on-pages/stats/,了解有多少人使用了该插件。
【讨论】: