從來未用過 WIN 主機,所以本人對這個問題也未研究過,今天幫別人弄了一下,還是很簡單,記錄一下方便有同樣問題的童鞋查詢。
開啟記事本,把下面程式碼貼上進去:
[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]
# 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
將這個 httpd.ini 檔案上傳到 WP 程式所在的目錄也就是與 index.php 在同一個目錄內。
之後進入 WP 後臺修改固定連結,比如:/%category%/%post_id%.html
重新整理部落格首頁,開啟文章連結看看連結地址中的 index.php 是不是消失了。
另外,網上還有說使用 cos-html-cache 靜態化外掛也可以實現,個人建議不要使用此方法,靜態化外掛也是我強烈建議新手不要用的一個外掛,之前寫過一篇:什麼情況下有必要使用靜態化快取外掛,對個人小博靜態化外掛,對你沒有任何用處,只會帶來無盡的問題,而且很多新手在知道很多問題是靜態化外掛造成的後,直接刪除外掛,這是錯誤的,拿 cos-html-cache 靜態化外掛為例,刪除外掛前,應首先進入外掛設定頁面,清除快取,之後再刪除外掛,不然快取檔案依然存在,頁面顯示的還是靜態化後的內容,外掛刪除也不會再更新了。