我正在尝试重定向
新闻/事件/finance-for-sdgs-high-level-meeting-bellagio-financeforsdgs-2/?lang=zh-hans
到
/finance-for-sdgs-high-level-meeting-financeforsdgs-bellagio-25-27-february-2015/?lang=zh-hans
但我不确定编码。以下是行不通的:
RewriteRule ^æ°é»/äºä»¶/finance-for-sdgs-high-level-meeting-bellagio-financeforsdgs-2/?lang=zh-hans$ http://ecosequestrust.org/finance-for-sdgs-high-level-meeting-financeforsdgs-bellagio-25-27-february-2015/?lang=zh-hans [R=301,L]
答案 0 :(得分:3)
您可以尝试使用\x
转义序列来转义Unicode:
RewriteRule ^\xE6\x96\xB0\xE9\x97\xBB\x2F\xE4\xBA\x8B\xE4\xBB\xB6/finance-for-sdgs-high-level-meeting-bellagio-financeforsdgs-2/$ http://ecosequestrust.org/finance-for-sdgs-high-level-meeting-financeforsdgs-bellagio-25-27-february-2015/ [R=301,L]
基本上,将新闻/事件
替换为\xE6\x96\xB0\xE9\x97\xBB\x2F\xE4\xBA\x8B\xE4\xBB\xB6
。这样,您就不需要依赖htaccess文件的编码。