久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      iis7 php偽靜態(tài)如何設(shè)置

      iis7 php偽靜態(tài)設(shè)置的方法:首先下載IIS的URLRewrite;然后點(diǎn)擊“Add Rules”并選擇“Blank rule”;最后添加一個(gè)偽靜態(tài)規(guī)則并確定保存即可。

      iis7 php偽靜態(tài)如何設(shè)置

      推薦:《PHP視頻教程》

      某個(gè)項(xiàng)目是PHP的,本地是Apache + PHP + MYSQL,服務(wù)器上的環(huán)境是IIS + PHP + MYSQL,開發(fā)完成準(zhǔn)備部署到服務(wù)器上發(fā)現(xiàn)偽靜態(tài)無法使用,原因是IIS不能解析.htaccess文件的內(nèi)容。

      如要在IIS下啟用偽靜態(tài) 就需要下載IIS的 URLRewrite,地址是: http://www.iis.net/expand/URLRewrite

      iis7 php偽靜態(tài)如何設(shè)置

      點(diǎn)擊那個(gè) or view additional downloads 轉(zhuǎn)到,服務(wù)器是64位的,所以我下載x64版本的URL Rewrite

      iis7 php偽靜態(tài)如何設(shè)置

      iis7 php偽靜態(tài)如何設(shè)置

      雙擊下載完成的文件,下一步、下一步到安裝完成

      iis7 php偽靜態(tài)如何設(shè)置

      重新打開IIS發(fā)現(xiàn)多了個(gè)URL Rewrite項(xiàng),打開全E文呀,不用怕其實(shí)配置還是很簡單的……

      iis7 php偽靜態(tài)如何設(shè)置

      如果我們要添加一個(gè)偽靜態(tài)規(guī)則那么點(diǎn)擊Add Rules,選擇 Blank rule

      iis7 php偽靜態(tài)如何設(shè)置

      我們只需要填寫三個(gè)部分

      name是這個(gè)規(guī)則的名稱,可以隨便取一個(gè)

      Pattern是匹配規(guī)則

      Action Properties是真實(shí)的地址

      iis7 php偽靜態(tài)如何設(shè)置

      還有個(gè)Test pattern是用來測(cè)試匹配規(guī)則是否正確,例如我想測(cè)試一下^category/(.+).html$ 這個(gè)匹配設(shè)置,Test Results還很貼心的給出了匹配結(jié)果和我們需要的參數(shù)列表,其中 {R:1}就是我想要的參數(shù),可以在 Rewrite URL中使用: cn/index.php?o={R:1} 是不是很簡單~

      順便提一下:我在測(cè)試的時(shí)候不小心在正則表達(dá)式后面多加了個(gè)空格,結(jié)果總是匹配失敗,所以大家要注意匹配規(guī)則的正則表達(dá)式前后不要帶空格~

      iis7 php偽靜態(tài)如何設(shè)置

      URLRewrite的規(guī)則和Apache中基本類似,例如在Apache中匹配規(guī)則是這樣的:

      <IfModule mod_rewrite.c>     RewriteEngine On     RewriteRule ^category/(.+).html$         cn/index.php?o=$1     RewriteRule ^substance/(.+)_(.+).html$   cn/index.php?o=$1&id=$2</IfModule>

      那么在IIS中我們只需要將其中的 $1 $2替換成 {R:1}, {R:2} 就可以了

      ^category/(.+).html$ cn/index.php?o={R:1}
      ^substance/(.+)_(.+).html$ cn/index.php?o={R:1}&id={R:2}

      熟悉了規(guī)則我們可以不用這個(gè)工具自己手工寫URL匹配規(guī)則了,在網(wǎng)站根目錄下修改web.config文件,system.webServer節(jié)點(diǎn)下增加rewrite項(xiàng),修改內(nèi)容為:

      <?xml version="1.0" encoding="UTF-8"?><configuration>     <system.webServer>         <rewrite>             <rules>                 <rule name="category">                     <match url="^category/(.+).html$" />                     <action type="Rewrite" url="cn/index.php?o={R:1}" />                 </rule>                 <rule name="substance">                     <match url="^substance/(.+)_(.+).html$" />                     <action type="Rewrite" url="cn/index.php?o={R:1}&amp;id={R:2}" />                 </rule>             </rules>         </rewrite>     </system.webServer></configuration>

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)