国产探花免费观看_亚洲丰满少妇自慰呻吟_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://m.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ā)表
主站蜘蛛池模板: 仪征市| 青铜峡市| 丹东市| 茂名市| 银川市| 太白县| 神木县| 政和县| 柯坪县| 肥城市| 呼图壁县| 通州区| 门源| 高平市| 乐昌市| 苏尼特左旗| 任丘市| 凤阳县| 沐川县| 原阳县| 常山县| 甘南县| 武川县| 逊克县| 交城县| 蓬安县| 汤阴县| 沂南县| 安义县| 鲜城| 新和县| 盐源县| 和硕县| 宝应县| 武夷山市| 桃源县| 和硕县| 南皮县| 洱源县| 安多县| 新竹县|