新聞發(fā)布
管理系統(tǒng)第一種:win系統(tǒng)下的wordpress程序偽靜態(tài)。
wordpress在win系統(tǒng)下的偽靜態(tài)前提是必須空間系統(tǒng)支持偽靜態(tài)設(shè)置,而我們也知道一般win系統(tǒng)支持的偽靜態(tài)規(guī)則為httpd.ini格式的,那我們首先就先新建一個(gè)文本文檔,將以下代碼復(fù)制粘貼在里面(這是我至今為止搜集到的完美的win系統(tǒng)偽靜態(tài)規(guī)則)。
[ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 # Protect httpd.ini and httpd.parse.errors files # from accessing through HTTP # wordpress 偽靜態(tài)規(guī)則 # For tag(中文標(biāo)簽以及標(biāo)簽翻頁的規(guī)則) RewriteRule /tag/(.*)/page/(/d+)$ /index/.php/?tag=$1&paged=$2 RewriteRule /tag/(.+)$ /index/.php/?tag=$1 # For category(中文分類以及分類翻頁的規(guī)則) RewriteRule /category/(.*)/page/(/d+)$ /index/.php/?category_name=$1&paged=$2 RewriteRule /category/(.*) /index/.php/?category_name=$1 # For sitemapxml RewriteRule /sitemap.xml /sitemap.xml [L] RewriteRule /sitemap.html /sitemap.html [L] RewriteRule /sitemap_baidu.xml /sitemap_baidu.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]
將以上代碼復(fù)制粘貼到文本文檔后,我們再將文本另存為httpd.ini,這樣我們的偽靜態(tài)規(guī)則就弄好了,我們只需要將這個(gè)文件上傳到空間更目錄,如果在后臺→固定鏈接選擇自定義鏈接輸入/%category%/%post_id%.html或是/%post_id%.html點(diǎn)擊保存就可以了,這里面我們還需要一個(gè)插件的支持,那就是去除分類URL中間的category,我們只需要在后臺插件安裝插件那搜索WP No Category Base,安裝啟用就可以了。這樣我們win系統(tǒng)下的wordpress程序偽靜態(tài)就完成了。
第二種:Linux系統(tǒng)下的偽靜態(tài)設(shè)置
這一種就是非常簡單的,我們知道Linux系統(tǒng)本身使用wordpress是完美的系統(tǒng),它的偽靜態(tài)設(shè)置是非常簡單的,我們只需要在后臺固定鏈接選擇自定義鏈接輸入/%category%/%post_id%.html或是/%post_id%.html點(diǎn)擊保存就可以了。同樣它這里也是需要配合WP No Category Base插件的,下面我就將Linux系統(tǒng)支持的.htaccess偽靜態(tài)規(guī)則內(nèi)容寫出來。
代碼如下:
# BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index/.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress
以上代碼也是一樣,需要我們新建一個(gè)文本文檔,然后將代碼復(fù)制粘貼進(jìn)去,點(diǎn)擊另存為.htaccess文件,再將此文件上傳至空間根目錄下就完成了。