您的位置:首页 > 其它

wordpress 中文 固定链接 not found 404

2013-11-04 21:00 323 查看
其实默认是支持中文标题链接的(3.7版本)。

1、

找到APACHE文件中的httpd.conf文件, 把#LoadModule rewrite_module modules/mod_rewrite.so 前的#去掉,加载rewrite模块。

2、 首先在httpd.conf配置文件中找到项目的目录:

加入 AllowOverride All

<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>

这些基本就差不多了。

如果还不行,有可能是主题的问题。

3、在主题下的functions.php中,加入下列代码:

里面的匹配应该和后台里面设置的一样。

<?php
// set permalink
function set_permalink(){
global $wp_rewrite;
$wp_rewrite->set_permalink_structure('/%postname%-%post_id%/');
}
add_action('init', 'set_permalink');
?>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: