wordpress去掉win主機(jī)鏈接中的index.php

字號:


    從來未用過win主機(jī),所以本人對這個問題也未研究過,今天幫別人弄了一下,還是很簡單,記錄一下方便有同樣問題的童鞋查詢。
    打開記事本,把下面代碼粘貼進(jìn)去:
    [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]
    保存時(shí)保存類型選擇“所有文件”,并輸入文件名稱:httpd.ini
    將這個httpd.ini文件上傳到wp程序所在的目錄也就是與index.php在同一個目錄內(nèi)。
    之后進(jìn)入wp后臺修改固定鏈接,比如:/%category%/%post_id%.html
    刷新博客首頁,打開文章鏈接看看鏈接地址中的index.php是不是消失了。
    另外,網(wǎng)上還有說使用cos-html-cache靜態(tài)化插件也可以實(shí)現(xiàn),個人建議不要使用此方法,靜態(tài)化插件也是我強(qiáng)烈建議新手不要用的一個插件,之前寫過一篇:淺談wordpress靜態(tài)化,對個人小博靜態(tài)化插件,對你沒有任何用處,只會帶來無盡的問題,而且很多新手在知道很多問題是靜態(tài)化插件造成的后,直接刪除插件,這是錯誤的,拿cos- html-cache靜態(tài)化插件為例,刪除插件前,應(yīng)首先進(jìn)入插件設(shè)置頁面,清除緩存,之后再刪除插件,不然緩存文件依然存在,頁面顯示的還是靜態(tài)化后的內(nèi)容,插件刪除也不會再更新了。