开发者

Showing non-ascii characters in URL

开发者 https://www.devze.com 2023-02-10 17:35 出处:网络
I\'m trying to make a page that will show Arabic/Hebrew in the URL. for example: www.mydomain.co.ar/אבא.php

I'm trying to make a page that will show Arabic/Hebrew in the URL. for example: www.mydomain.co.ar/אבא.php

Problem is, when i upload the page to the Apache server and try to browse to that page either with "www.mydomain.co.ar/אבא.php" or the percent encoding way "www.mydomain.co.ar%D7%90%D7%91%D7%90.php" i get a 404.

Then i list the directory and apache sees àáà.php. I know there is 开发者_运维技巧a way to show up non ASCII in url, wikipedia is doing it for ages.

My thoughts are maybe .htaccess rewrite? if so how can i accomplish that?


Looks like you have to tell apache that the file system is encoded in UTF-8 (or whatever). Maybe starting apache with an UTF-8 locale active (LC_CTYPE=ar.utf8 or similar) helps there.

Wikipedia parses the URLs in the PHP software (and then asks the database about the right article), so this does not necessarily say how Apache does this.

0

精彩评论

暂无评论...
验证码 换一张
取 消