wordpress伪静态设置

wordpress伪静态设置

wordpress默认的文章链接是动态的,这样子对搜索引擎不是很友好,因此为了seo的需要以及美观的需要,我们需要手动设置一下才可以实现wordpress博客文章的伪静态.

如下图所示,进入wordpress博客管理后台:

1。点菜单紧右边的“设置”

wordpress伪静态设置

点选其下的"固定链接"或者“永久链接”(Permalinks)

wordpress伪静态设置

点选“自定义结构",并输入你的自定义结构,何苦呢一般都是这样子写的“/%postname%.html“

这样子的话,如果是用中文题目,需要为每篇文章手动设置一下永久链接,否则中文会被转变成一些乱码。

永久链接使用“/%postname%.html”的结构以来层次比较简单,二来也便于在永久地址用加入一些关键词的拼音之类的,更加有利于seo。

wordpress伪静态设置

点页面下方的按钮“保存更改”

wordpress伪静态设置

此时在 WordPress 的根目录自动生成里一 .htaccess 文件,内容大体如下:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

另外你也可以使用其他一些自定义永久链接写法及对应效果:

/%year%/%monthnum%/%day%/%postname%/
/%year%/%monthnum%/%postname%.html
/%year%/%monthnum%/%day%/%postname%.html
/%category%/%postname%.html

/%year%/%monthnum%/%postname%  

以上就是“wordpress伪静态设置”的简单设置。

Tagged , . Bookmark the permalink.

One Response to wordpress伪静态设置

  1. 阿里 says:

    这种伪静态最好配合Sitemap,因为百度对伪静态的抓取不是很智能。

Leave a Reply