在Twitter上分享时,URL中的阿拉伯字符 [英] Arabic characters in URL while sharing on Twitter
问题描述
我在尝试在Twitter上共享包含阿拉伯字符的URL时遇到了问题:
I'm facing an issue trying to sharing an URL which includes arabic characters on Twitter:
http://example.com/قرعة-تصفيات-أفريقيا-مصر-تواجه-نيجيريا/
当我单击共享"时,在推文框中显示相同的URL,但是当我实际进行推文时,它仅链接到 http://example.com
,其余的链接网址丢失.
When i click on "share" the same URL is showed in the tweet box, but when I actually tweet, it just links to http://example.com
, and the rest of the URL is lost.
我尝试使用 urlencode()
,但是生成的URL太长且无法鸣叫.我该怎么解决?
I tried using urlencode()
, but the generated URL is too long and impossible tweet. How could I solve this?
推荐答案
如果您是网站的所有者,则可以编写htaccess RewriteRule
生成较短的或英文的url或使用重定向文件.
If you are owner of website, you can write htaccess RewriteRule
for generate shorter or English url or use Redirection file.
RewriteEngine on
RewriteRule ^redirect/(.*)/?$ ./redirector.php?key=$1 [QSA,L,NC]
如果您是网站用户,则可以使用较短的URL网站,例如 bit.ly 或
And if you are user of website just you can use URL shorter websites like bit.ly or goo.gl
这篇关于在Twitter上分享时,URL中的阿拉伯字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!