wordpress在win主机下的伪静态设置代码

1、首页复制下面代码,考入到记事本中,改名为 httpd.ini

  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]

2、上传到虚拟主机根目录

3、然后去WP后台设置固定连接:/%post_id%.html

好了,基本就ok了

如果你做了网站地图,地图打不开的话,那么就在加两段代码

  1. RewriteRule /sitemap.html /sitemap.html [L]

  2.     RewriteRule /sitemap_baidu.xml /sitemap_baidu.xml [L]

这样你的地图链接打开了,有需要的朋友就去试试吧。


你可能感兴趣的:(wordpress,伪静态,Win)