.

protecter

Universal Analytics

解决Word Press在Windows主机下伪静态无法打开网页的问题


Windows主机需要上传httpd.ini文件到根目录。下面是操作步骤和配置方法:   

1、新建一个txt文件,重命名为httpd.ini,就是把后缀.txt改为.ini。 

2、打开新建的文件,复制下面的代码:

  1. [ISAPI_Rewrite]
  2. # 3600 = 1 hour
  3. CacheClockRate 3600
  4. RepeatLimit 32
  5. # Protect httpd.ini and httpd.parse.errors files
  6. # from accessing through HTTP
  7. # Rules to ensure that normal content gets through
  8. RewriteRule /sitemap.xml /sitemap.xml [L]
  9. RewriteRule /favicon.ico /favicon.ico [L]
  10. # For file-based wordpress content (i.e. theme), admin, etc.
  11. RewriteRule /wp-(.*) /wp-$1 [L]
  12. # For normal wordpress content, via index.php
  13. RewriteRule ^/$ /index.php [L]
  14. RewriteRule /(.*) /index.php/$1 [L]
3、保存后将文件上传到网站的根目录。
   
4、在WordPress后台的固定链接中选择自定义,输入希望实现的链接样式。具体格式为/%category%/%post_id%.html,2个斜杠中间可以替换代码(注意不要有空格)。

可替换的代码如下:

 %year% 年份
 %monthnum% 月份
 %day% 日期
 %hour% 小时
 %minute% 分钟
 %second% 秒
 %postname% 文章名
 %post_id% 文章的ID
 %category% 目录
 %author% 作者  



相关博文:

0 评论 :

发表评论