日期:2014-05-16  浏览次数:20696 次

wordpress 在windows主机下伪静态设置方法及规则
建立httpd.ini文件,以记事本打开。写入以下代码!保存上传服务器根目录(我公司WEB目录下)。可以到官方下载规则!!!


[ISAPI_Rewrite]

# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# 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]
RewriteRule /robots.txt/robots.txt [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]

然后在wordpress后台设置=>固定连接=>选择自定义结构=>输入以下代码

/%year%%monthnum%%day%%post_id%.html (推荐大家本站自用的固定连接格式)

当然这里可以选择N中类型,但是无论你选择何种类型,后面必须加上%post_id%这个玩意,负责会报错。切记!!!

下面给出几个参考,但是我建议用我的。我感觉我的就不错哈——!

%year% 年份

%monthnum% 月份

%day% 日期

%hour% 小时

%minute% 分钟

%second% 秒

%post_id% 文章的ID

%category% 目录

%author% 作者