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

  • 来源:
  • 更新日期:2018-05-04

摘要:1、首页复制下面代码,考入到记事本中,改名为 httpd.ini [ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 # Protect httpd.ini and httpd.parse.errors files # from accessing through HTTP

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

[ISAPI_Rewrite]

20140308164024_2956.jpg

# 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]

# 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]

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

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

好了,基本就ok了

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

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

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

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