WP伪静态对Linux主机是十分容易的事情,但在Windows主机IIS情况下就比较毒手了,你是否遇到了一样的问题呢?今天就来教你如安在Win主机IIS情况下进行WP伪静态配置。
Windows主机IIS情况下伪静态需要主机启用了Rewrite模块,不然是不会起作用的。主机启用了Rewrite模块,剩下的只需要一个Httpd.ini就可以解决问题了。
httpd.ini是指wordpress法度在windows虚拟主机上的伪静态设置。下面就贴出WP伪静态的Httpd.ini代码:
[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 /sitemap_百度.xml /sitemap_百度.xml [L]
RewriteRule /sitemap.html /sitemap.html [L]
RewriteRule /archivers/(.*) /archivers/$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]
把上面的代码复制保存为httpd.ini文件,上传至网站根目录便可。