传递阿拉伯参数的正确方法

时间:2014-09-11 08:47:18

标签: php apache .htaccess mod-rewrite

 <?php
   $tit = rawurldecode("نقفورالثاني-فوكاس");
   $cap = rawurldecode("الطريق-للقمة");
   ?>
   <a href = '<?php echo "road.php?title=$tit&caption=$cap" ; ?>'>

产生奇怪的%空格字符,如何正确发送阿拉伯语参数,它正在变为:

http://www.nikephorosphokas.com/%D9%86%D9%82%D9%81%D9%88%D8%B1%D8%A7%D9%84%D8%AB%D8%A7%D9%86%D9%8A%D9%81%D9%88%D9%83%D8%A7%D8%B3/%25D9%2586%25D9%2582%25D9%2581%25D9%2588%25D8%25B1%25D8%25A7%25D9%2584%25D8%25AB%25D8%25A7%25D9%2586%25D9%258A-%25D9%2581%25D9%2588%25D9%2583%25D8%25A7%25D8%25B3/%25D8%25A7%25D9%2584%25D8%25B7%25D8%25B1%25D9%258A%25D9%2582-%25D9%2584%25D9%2584%25D9%2582%25D9%2585%25D8%25A9/

第一次是正确的,因为它通过干净的网址传递,但第二部分无论采用何种方法都无效:

RewriteCond %{THE_REQUEST} /road.php\?title=([^&\s]+)&caption=([^&\s]+)\s [NC]
RewriteRule . نقفورالثانيفوكاس/%1/%2/? [R=301,L]

RewriteRule ^نقفورالثانيفوكاس/([^/]+)/$ road.php?title=rawurldecode($1) [QSA,L]
RewriteRule ^نقفورالثانيفوكاس/([^/]+)/([^/]+)/$ road.php?title=rawurldecode($1)&caption=rawurldecode($2) [QSA,L]

非常感谢

0 个答案:

没有答案