使用以下方法對(duì)win空間下的wordpress設(shè)置偽靜態(tài)前,請(qǐng)先詢問主機(jī)商是否支持偽靜態(tài)(IIS Rewrite 組件),這個(gè)是IIS6.0下最新的wordpress偽靜態(tài)規(guī)則。
win主機(jī)wordpress偽靜態(tài)規(guī)則:(以下涉及的代碼采自互聯(lián)網(wǎng))
1.創(chuàng)建一個(gè)php.ini文件(創(chuàng)建一個(gè)txt文件,然后得命名為php,更改.txt的后綴為.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
RewriteRule /tag/(.*) /index.php?tag=$1
RewriteRule /software-files/(.*) /software-files/$1 [L]
RewriteRule /images/(.*) /images/$1 [L]
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]
2.保存后,把php.ini文件上傳到網(wǎng)站根目錄,然后登陸wordpress博客后臺(tái),在設(shè)置——固定鏈接中的自定義結(jié)構(gòu)設(shè)置url形式即可。
提醒:要想使用wordpress程序建站的站長(zhǎng),最好還是選擇linux+apache結(jié)構(gòu)搭建的主機(jī)或用來搭配服務(wù)器環(huán)境,因?yàn)榭梢允∠虏簧俾闊?/P>
更多信息請(qǐng)查看IT技術(shù)專欄