在服务器上开启筛选器,一般的步骤
然后在httpd.ini 中加入如下代码:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
#解决中文tag无法访问的问题
RewriteRule /tag/[^/]+)/([^/]+)/?([0-9]+)?/ /index.php?tag=$1&paged=$3 [L]
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# Rules to ensure that normal content gets through
RewriteRule /sitemap.xml /sitemap.xml [L]
RewriteRule /favicon.ico /favicon.ico [L]
# For file-based wordpress content (i.e. theme), admin, etc.
RewriteRule /wp-(.*) /wp-$1 [L]
# For normal wordpress content, via index.php
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]
下面的内容,是用在后台设定想要伪静态显示达到的效果对应的字符,例如想要显示成 2013/10.html
那对应的自定义格式就写/%year%/%monthnum%.html
%monthnum%:日志发表的月份,如05
%day%:日志发表的日期,如28
%hour%:日志发表的时间(小时),如15
%minute%:日志发表的时间(分钟),如43
%second%:日志发表的时间(秒),如33
%postname%:日志标题的缩略版本(日志/页面编辑界面上的日志别名)。因此“This Is A Great Post!”在URI中会变成this-is-a-great-post。
%post_id%:日志的唯一ID,如423
%category%:分类名称的缩略版本(添加新分类/编辑界面上的分类别名)。
但是修改之后中文tag又不能访问了,别担心,接着看下一步。
修改wp-include中的classes-wp.php,之前版本可能是classes.php。
原代码:
$pathinfo = $_SERVER['PATH_INFO'];
替换为:
$pathinfo = mb_convert_encoding($_SERVER['PATH_INFO'], “UTF-8″, “GBK”);
原代码:
$req_uri = $_SERVER['REQUEST_URI'];
替换为:
$req_uri = mb_convert_encoding($_SERVER['REQUEST_URI'], “UTF-8″, “GBK”);
要饭二维码
洪哥写文章很苦逼,如果本文对您略有帮助,可以扫描下方二维码支持洪哥!金额随意,先行谢过!大家的支持是我前进的动力!

文章的版权
本文属于“洪哥笔记”原创文章,转载请注明来源地址:wordpress伪静态相关:http://www.splaybow.com/post/wordpress-rewrite.html
如果您在服务器运维、网络管理、网站或系统开发过程有需要提供收费服务,请加QQ:8771947!十年运维经验,帮您省钱、让您放心!
亲,如果有需要,先存起来,方便以后再看啊!加入收藏夹的话,按Ctrl+D!
发布时间:2013/10/8 16:54:57 | 编辑:fly dream | 分类:SEO | 浏览: