国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > Shopex > 正文

shopex ISAPI_Rewrite3.x中文亂碼解決辦法

2024-08-30 19:06:40
字體:
供稿:網(wǎng)友

現(xiàn)在換用了 ISAPI_Rewrite 3.x 發(fā)現(xiàn)編碼后的字符會變成亂碼,如果直接使用中文不編碼,則會被格式化為GBK字符串,因為 ISAPI_Rewrite 默認(rèn)是以 UTF-8 的編碼接收的.

解決方案

翻了手冊,發(fā)現(xiàn)有一個配置參數(shù)可以解決該問題,代碼如下:

  1. nounicode|NU 
  2. If NU flag is set, transformation from Unicode to UTF-8 will not take place and all Unicode characters remain encoded in %xx format. 
  3. nounicode|NU 

如果標(biāo)志設(shè)置,從Unicode轉(zhuǎn)換為UTF-8不會發(fā)生,所有的Unicode字符編碼為%xx的保持格式.

在你的RewriteRule 規(guī)則后臺添加 NU 即可恢復(fù)正常.

關(guān)于ISAPI_Rewrite中文變亂碼解決方法,無論何種情況,統(tǒng)一解決思想:

1、在傳輸URL時,將中文進行urlencode,這樣是沒錯的,把最后一句的規(guī)則添加個NU參數(shù),RewriteRule ^(.*)$ index.php?$1 [QSA,NU,PT,L]

配置舉例:

傳遞的URL地址,代碼如下:

http://www.survivalescaperooms.com/sell/search-htm-kw-%C6%BD%B0%E5%B5%E7%C4%D4.html

原來相應(yīng)的RewriteRule為:

RewriteRule ^(.*)-htm-(.*)$ $1.php?$2

修正后的規(guī)則是:

RewriteRule ^(.*)-htm-(.*)$ $1.php?$2 [NU]

shopex原規(guī)則為:

  1. RewriteBase / 
  2. RewriteCond %{REQUEST_FILENAME} .(html|xml|json|htm|php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|cgi|shtml|shtm|phtm|xml)$ 
  3. RewriteCond %{REQUEST_FILENAME} !-f 
  4. RewriteCond %{REQUEST_FILENAME} !-d 
  5. RewriteRule ^(.*)$ index.php?$1 [L] 

修改后的規(guī)則為:

  1. RewriteBase / 
  2. RewriteCond %{REQUEST_FILENAME} .(html|xml|json|htm|php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|cgi|shtml|shtm|phtm|xml)$ 
  3. RewriteCond %{REQUEST_FILENAME} !-f 
  4. RewriteCond %{REQUEST_FILENAME} !-d 
  5. RewriteRule ^(.*)$ index.php?$1 [NU,L]

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 东安县| 左贡县| 靖西县| 花莲县| 剑河县| 陇西县| 肥乡县| 资源县| 璧山县| 灯塔市| 项城市| 长白| 辽阳市| 汉川市| 叶城县| 镇江市| 牙克石市| 郯城县| 临武县| 江陵县| 高碑店市| 灵石县| 黔东| 玛多县| 仁布县| 嘉兴市| 娱乐| 城口县| 滦南县| 大悟县| 彭山县| 桦川县| 金沙县| 湛江市| 大关县| 义乌市| 开江县| 宣化县| 三台县| 四平市| 赣州市|