PHP 偽靜態後 訪問包含中文的URL 報403錯誤的解決方案

來源:互聯網
上載者:User

作者:Tank http://hi.baidu.com/uroot   2008.1.31 Tank原創
配置: 
   httpd.conf中 設定檔寫法同Linux版本相同.
使用環境:apache 2.2.x ,WIndows Server 2003 or Windows XP
首先保證你的apache2.2.x能正常啟動,並提供服務。IE訪問伺服器HTTP時出現It works 字樣。
1:你需要到http://www.zlatkovic.com/pub/libxml/ 下載一個iconv-1.9.2 的 iconv.dll 放到windows system32目錄.如果連結iconv時選擇靜態連結庫iconv_a.lib.則不需要此步驟。其他如MSVCRT80.DLL等,如果需要,一併部署到目標Server
的system32目錄.
2:拷貝mod_encoding.dll到Apache modules目錄。比如C:\apache2\modules
3.修改apache的conf子目錄中的設定檔: httpd.conf 
加入如下配置:
LoadModule headers_module modules/mod_headers.so
##mod_headers必須載入
LoadModule encoding_module modules/mod_encoding.dll
<IfModule mod_headers.c>
Header add MS-Author-Via "DAV"
</IfModule>
<IfModule mod_encoding.c>
EncodingEngine on
NormalizeUsername on
SetServerEncoding GBK
DefaultClientEncoding UTF-8 GBK GB2312
AddClientEncoding "(Microsoft .* DAV $)" UTF-8 GBK GB2312
AddClientEncoding "Microsoft .* DAV" UTF-8 GBK GB2312
AddClientEncoding "Microsoft-WebDAV*" UTF-8 GBK GB2312
</IfModule>然後重新啟動apache 。 如果apache啟動出錯,請看apache 安裝目錄下logs子目錄的error.log的錯誤提示.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.