使用‘Permalink’标签的文章存档
wordpress默认的url是动态的,当然要修改掉,以达到搜索引擎友好(search engine friendly)的目的。现在基本上很多美国主机都支持Mod Rewrite功能,wordpress也自带了.htaccess文件,所以我们只需要在后台进行简单设置即可达到url伪静态现实的目的了。
其实wordpress也提供了几种默认的格式,如按年份月份日期来显示等,这对于日志来说是好的,但对于seo来说是不够的。所以我找到了几种常用的永久链接的设置参数共大家参考来设置自己的url。
登录到wordpress后台,“设置”Options→“永久链接”Permalink,选“自定义结构”中填写永久链接的格式。
常用的写法有:
———————————————————
样式:http://www.yourwebsite.com/123.html
写法:/%post_id%.html
样式:http://www.yourwebsite.com/archives/123.html
写法:/archives/%post_id%.html
样式:http://www.yourwebsite.com/2007/09/16/post-name.html
写法:/%year%/%monthnum%/%day%/%postname%.html
样式:http://www.yourwebsite.com/2007/03/post-name.html
写法:/%year%/%monthnum%/%postname%.html
样式:http://www.yourwebsite.com/category/post-name.html
写法: /%category%/%postname%.html
样式:http://www.yourwebsite.com/archives/post-name.html
写法:/archive/%postname%.html
样式:http://www.yourwebsite.com/post-name.html
写法:/%postname%.html
说明:
%year% 日志发布的年,4位数字,如:2004
%monthnum% 日志发布的月份,2位数字,如:05
%day% 日志发布当月的第几天,2位数字,如:28
%hour% 日志发布时间中的“小时”,2位数字,如:15
%minute% 日志发布时间中的“分钟”,2位数字,如:43
%second% 日志发布时间中的“秒”,2位数字,如:33
%postname% 一串处理过的日志标题。如,日志标题为“This Is A Great Post!”,那么%postname%表示为“this-is-a-great-post”
%post_id% 日志的唯一编号
%category% 日志所在的分类
%author% 日志的作者
———————————————
我本人最推荐此种写法:
样式:http://www.yourwebsite.com/category/post-name.html
写法: /%category%/%postname%.html
特别是英文网站中可以将目录名和文章名的关键词都嵌入其中,对于seo有绝大的帮助,当然也可以去掉后面的html后缀来表现成目录的形式更好。