Windows主机IIS配置WordPress伪静态的方法

2011年03月02日 软件技术 暂无评论 阅读 2,502 次

Windows主机的服务器,如果利用IIS作为web服务器搭建WordPress程序,那么WordPress伪静态需要利用httpd.ini配置(类似Linux主机的.htaccess配置。不过个人建议WordPress建站最好用Linux主机。下面是我的httpd.ini配置信息:
[ISAPI_Rewrite]
# Defend your computer from some worm attacks
#RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]
# 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

RewriteCond Host: ^oswhy\.com$
RewriteRule (.*) http\://www\.oswhy\.com$1 [R,I]
RewriteRule /software-files/(.*) /software-files/$1 [L]
RewriteRule /images/(.*) /images/$1 [L]
RewriteRule /sitemap.xml /sitemap.xml [L]
RewriteRule /sitemap.xml.gz /sitemap.xml.gz [L]
RewriteRule /xmlrpc.php /xmlrpc.php [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]

评论已关闭!