人人人妻人人人妻人人人,99精品国产综合久久久久五月天 ,欧美白人最猛性XXXXX,日韩AV无码免费播放

News新聞

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

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

htaccess轉換httpd.ini方法及案例參考

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