WordPress 中文URL不支援 Apache Rewrite 不支援中文 Ipage不支援中文

來源:互聯網
上載者:User

標籤:http   os   io   art   for   問題   

WordPress 站,在國內空間上好好的,只是限制容量。。。

於是平移到國外Ipage空間上去,但是發現個致命的問題:不支援中文URL!!!

http://my.oschina.net/cart/

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>400 Bad Request - http://my.oschina.net/cart/</title></head><body><h1>Bad Request</h1><p>Your browser sent a request that this server could not understand.<br /></p><p>Additionally, a 403 Forbiddenerror was encountered while trying to use an ErrorDocument to handle the request.</p></body></html>
怎麼辦呢?

http://my.oschina.net/cart/

發Ticket給老外,老外說技術正在努力解決,第二天指了一條瞎路給我走。。。

最後無奈,自己動手吧!

問題分析:空間不支援中文,那麼我們必須繞開中文了,聰明的同學想到了URL編碼。

http://my.oschina.net/cart/

問題解決:1.超連結進行2次urlencode即可繞開瀏覽器開啟時是中文的問題:  <a href="<?php echo urlencode(urlencode(‘模板‘));?>">模板</a>2.在index.php最頂部,反解你的URL: $_SERVER[‘REQUEST_URI‘] = urldecode(urldecode($_SERVER[‘REQUEST_URI‘]));//To solve Ipage.com not support the chinese

最終,Apache Rewrite 不支援中文URL的問題,完美解決!

Tips:聰明的同學會發現,這樣會影響SEO收錄,url被2次編碼了,最好的辦法還是找服務商吧!

這也是服務商沒有搞定的權宜之計!!!

http://my.oschina.net/cart/



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.