网站根目录下 创建 httpd.ini 文件 内容如下:
[ISAPI_Rewrite] # Defend your computer from some worm attacks #RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 #Protect httpd.ini and httpd.parse.errors files # from accessing through HTTP RewriteRule /category/(.*).html/page/(.*)/?$ /index\.php\?category_name=$1&paged=$2 RewriteRule /tag/(.*).html /index\.php\?tag=$1 RewriteRule /tag/(.*) /index\.php\?tag=$1
RewriteRule /(about_me|blog_log|contact|download|about-copyright|links|favor|archives|tags|sitemap|link|message|授权)/ /index\.php\?pagename=$1 RewriteRule /category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2 RewriteRule /category/?(.*)/ /index\.php\?category_name=$1 RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?author_name=$1&feed=$2 RewriteRule /author/?(.*) /index\.php\?author_name=$1 RewriteRule /feed/?$ /index.php\?feed=rss2 RewriteRule /comments/feed/?$ /index.php\?feed=comments-rss2 RewriteRule /page/(.*)/ /index\.php\?paged=$1 RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/?([0-9]+)?/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&page=$5 RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4 RewriteRule /([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3 RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/trackback/?$ /wp-trackback\.php\?year=$1&monthnum=$2&day=$3&name=$4&tb=1 RewriteRule /software-files/(.*) /software-files/$1 [L] RewriteRule /images/(.*) /images/$1 [L] RewriteRule /sitemap.xml /sitemap.xml [L] RewriteRule /favicon.ico /favicon.ico [L] RewriteRule /sucai/(.*) /sucai/$1 [L] RewriteRule /old/(.*) /old/$1 [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]
后台配置:
要安装Permalink Editor插件!
修改 wp-includes/class-wp.php 如下两行
$pathinfo = mb_convert_encoding($_SERVER['PATH_INFO'], "UTF-8", "GBK");
$req_uri = mb_convert_encoding($_SERVER['REQUEST_URI'], "UTF-8", "GBK");