欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php 偽靜態(tài)之IIS篇

 更新時(shí)間:2014年06月02日 11:03:52   作者:  
上篇文章我們講解了APACHE服務(wù)器下偽靜態(tài)的實(shí)現(xiàn),不過在國內(nèi)還是IIS的服務(wù)器要多些,特別是個(gè)人站長,那么,我們?cè)賮韺W(xué)習(xí)下IIS下php偽靜態(tài)的實(shí)現(xiàn)過程吧

有的win主機(jī)IIS不支持 .htaccess 文件, 我在這里指的不是本地 在本地的話用apmserv服務(wù)器可以用.htaccess 文件,用apmserv服務(wù)器環(huán)境配置偽靜態(tài)可以看 php 偽靜態(tài) (url rewrite mod_rewrite 重寫) 這篇文章,講的很詳細(xì).

這里我們主要講解httpd.ini 廢話不說直接看效果~

例: www.dbjr.com.cn/index.php
我們想讓他用 www.dbjr.com.cn/index.html 來直接訪問
www.dbjr.com.cn/newxx.php?=10 [newxx.php 是新聞的詳細(xì)頁面]
我們把他偽靜態(tài)成為 www.dbjr.com.cn/new-10.html
實(shí)現(xiàn)過程如下:httpd.ini 的源文件

[ISAPI_Rewrite]
# 3600 = 1 hour
# CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteRule ^/httpd(?:\.ini|\.parse\.errors).* [F,I,O]
RewriteRule /index.html /index.php
RewriteRule /new-([0-9]+).html$ /newxx\.php\?uid=$1上面的例子可以看出 RewriteRule /index.html /index.php 是把index.php 轉(zhuǎn)換為 index.html
RewriteRule /new-([0-9]+).html$ /newxx\.php\?uid=$1 轉(zhuǎn)換為 new-10{這個(gè)10為id=幾的值}.html

很簡單吧。 這種偽靜態(tài)一般 win主機(jī)的空間商基本都支持的!

相關(guān)文章

最新評(píng)論