Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Arabic characters in URL while sharing on Twitter

I'm facing an issue trying to sharing an URL which includes arabic characters on Twitter:

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.

I tried using urlencode(), but the generated URL is too long and impossible tweet. How could I solve this?

like image 900
Haroon Akram Avatar asked Apr 15 '15 12:04

Haroon Akram


1 Answers

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]

And if you are user of website just you can use URL shorter websites like bit.ly or goo.gl

like image 176
Ebad ghafoory Avatar answered Oct 05 '22 04:10

Ebad ghafoory