下面我就說說兩種IIS For Windows環境下的WP偽靜態是怎么實現的:
第一種推薦使用,我的博客就是采用這種方式,本人親測可用。你只要按照下面的步驟操作就好:
首先建一個txt文件,然后寫入代碼,再把txt文件保存為httpd.ini文件,接著就是在網站的根目錄上傳這一個httpd.ini文件,然 后就可以像Linux設置一樣,可以直接在后臺直接設置固定鏈接,這需要服務器主機裝有Rewrite 組件,否則不會起效果。不過,一般都會裝的,畢竟這些大家都懂得。。
httpd文件中的代碼如下:(注意:直接復制就好,保存名稱為httpd,我第一次都是少了個d才提示錯誤)
[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_baidu.xml /sitemap_baidu.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]
來源:破折君博客
原文鏈接:http://www.pzboy.com/soft/php/wordpress-pseudo-static/