1.IIS 下偽靜態(tài)設(shè)置
首先請(qǐng)下載以下附件: IIS Rewrite模塊 附件:Rewrite.rar
其中httpd.ini為配置文件內(nèi)容如下:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# Rewrite 系統(tǒng)規(guī)則請(qǐng)勿修改 PHPCMS3.0
RewriteRule ^(.*)/show-([0-9] )-([0-9] )/.html$ $1/show/.php/?itemid=$2&page=$3
RewriteRule ^(.*)/list-([0-9] )-([0-9] )/.html$ $1/list/.php/?catid=$2&page=$3
RewriteRule ^(.*)/show-([0-9] )/.html$ $1/show/.php/?specialid=$2
將其解壓到任意目錄,如: C:/Rewrite
打開“控制面板→治理工具→IIS信息服務(wù)治理器→網(wǎng)站→您的站點(diǎn)→屬性”。在“ISAPI篩選器”項(xiàng)點(diǎn)擊 “添加”, 篩選器名稱填入Rewrite,可執(zhí)行文件為C:/Rewrite/Rewrite.dll (假如您解壓到其它目錄請(qǐng)?zhí)钊胂鄳?yīng)地址)
重新啟動(dòng)IIS.
看到狀態(tài)為向上時(shí)成功。
2.Apache 下偽靜態(tài)設(shè)置
請(qǐng)首先咨詢您的空間服務(wù)商,空間是否支持 Rewrite 以及是否支持對(duì)站點(diǎn)目錄中 .htaccess 的文件解析,否則即便按照下面的方法設(shè)置好了,也無法使用。(需要服務(wù)器支持Apache的Mod_Rewrite功能)
服務(wù)器端設(shè)置 rewrite:
1,虛擬主機(jī)用戶:
------------------------------------------------------------------------
打開文件httpd.conf 文件(apache目錄下面的文件)
以apache2.2.3設(shè)置為例,配置虛擬主機(jī)下的rewrite
在主目錄里面需要添加代碼 AllowOverride Options FileInfo
取消 LoadModule rewrite_module modules/mod_rewrite.so前面的 #
重新啟動(dòng)Apache.
-------------------------------------------------------------------------
Apache Web Server(獨(dú)立主機(jī)用戶):
首先確定您使用的 Apache 版本,及是否加載了 mod_rewrite 模塊。
新聞熱點(diǎn)
疑難解答
圖片精選