色欲av无码一区二区三区,亚洲国产精华液网站w,精产国品一二三产品天堂,国产sm主人调教女m视频

News新聞

業(yè)界新聞動態(tài)、技術(shù)前沿
Who are we?

您的位置:首頁      網(wǎng)站知識      htaccess轉(zhuǎn)換httpd.ini方法及案例參考

htaccess轉(zhuǎn)換httpd.ini方法及案例參考

標(biāo)簽: 發(fā)布日期:2013-10-11 00:00:00 1817
 案例1:httpd.ini適合IIS使用,.htaccess適合apache/' target='_blank'>Apache使用,nginx.conf適合Nginx使用
轉(zhuǎn)換前:httpd.ini
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
RewriteRule ^(.*)/view-(.*)-(.*)\.htm$ $1/view\.php\?s=$2&y=$3
轉(zhuǎn)換后:.htaccess(注意上面的紅斜干)
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)view-(.*)-(.*)\.htm$ $1/view.php?s=$2&y=$3 
 
案例2:從apache轉(zhuǎn)到iis下,碰到.htacess轉(zhuǎn)換httpd.ini,分享下方法。
 
轉(zhuǎn)換前:.htacess規(guī)則:
 
RewriteEngine On
 
RewriteCond %{HTTP_HOST} !^www.0755wzjs.com$
 
RewriteRule ^(.*)$ http://www.0755wzjs.com/$1 [R=301,L,NC]
 
RewriteBase /
 
RewriteRule ^([^-/\.\_\-]+)\.html$ $1.php?
 
RewriteRule ^([^-/\.\_\-]+)-op([^-/]+)-sor([^-/]+)-det([^-/]+)\.html$ $1.php?op=$2&sor=$3&det=$4
 
RewriteRule ^([^-/\.\_\-]+)-op([^-/]+)-sor([^-/]+)\.html$  $1.php?op=$2&sor=$3
 
RewriteRule ^([^-/\.\_\-]+)-sor([^-/]+)\.html$  $1.php?sor=$2
 
RewriteRule ^([^-/\.\_\-]+)-op([^-/]+)\.html$  $1.php?op=$2
 
RewriteRule ^([^-/\.\_\-]+)-page([^-/]+)\.html$  $1.php?page=$2
 
RewriteRule ^([^-/\.\_\-]+)-op([^-/]+)-sor([^-/]+)-page([^-/]+)\.html$ $1.php?op=$2&sor=$3&page=$4
 
轉(zhuǎn)換后http.ini的寫法:
 
 [ISAPI_Rewrite]
 
RewriteRule /([^-/\.\_\-]+)\.html$ /$1.php?
 
RewriteRule /([^-/\.\_\-]+)-op([^-/]+)-sor([^-/]+)-det([^-/]+)\.html$ /$1.php?op=$2&sor=$3&det=$4
 
RewriteRule /([^-/\.\_\-]+)-op([^-/]+)-sor([^-/]+)\.html$  /$1.php?op=$2&sor=$3
 
RewriteRule /([^-/\.\_\-]+)-sor([^-/]+)\.html$  /$1.php?sor=$2
 
RewriteRule /([^-/\.\_\-]+)-op([^-/]+)\.html$  /$1.php?op=$2
 
RewriteRule /([^-/\.\_\-]+)-page([^-/]+)\.html$  /$1.php?page=$2
 
RewriteRule /([^-/\.\_\-]+)-op([^-/]+)-sor([^-/]+)-page([^-/]+)\.html$ /$1.php?op=$2&sor=$3&page=$4
 
 
 
 
 
在.htacess轉(zhuǎn)換httpd.ini轉(zhuǎn)換結(jié)果匯中大家明顯看到我們做了修改的幾個地方,有顏色的部分就是修改過的,在.htacess轉(zhuǎn)換httpd.ini轉(zhuǎn)換中,就是要讓apache和iis理解我們想要它做什么。上面代碼不難看出:
 
首先是對規(guī)則的定義要變,從rewrite_module變成isapi_rewrite。
 
其次是路徑要變,.htacess的路徑是定義在頭部中,而httpd.ini是定義在每行規(guī)則里,.htacess轉(zhuǎn)換httpd.ini轉(zhuǎn)
 
換時將.htacess中^符號換成/,在獨立頁面前面加上路徑/,以我自己理解這個/應(yīng)該是相對目錄的根目錄。