I’m trying to do a somewhat simple thing with no luck – I want to display Hebrew/Arabic characters in my URL.
For example: I want the URL to display a file named: aאm.php
So I’ve percent encoded the middle UTF8 characters and the result is: a%D7%90m.php. I’ve uploaded a%D7%90m.php to my server (Apache) and tried to request the pages http://www.example.com/a%D7%90m.php & http://www.example.com/aאm.php but my server responded:
The requested URL
/a%D7%90m.phpwas not found on this server.
So I tried to upload aאm.php (without the percent encoding) instead, but again no luck when browsing http://www.example.com/a%D7%90m.php & http://www.example.com/aאm.php.
How to fix this issue?
The solution was to set a mod rewrite the
.htaccessin http://www.example.com. For example, ifyou want your link to be http://www.example.com/عربية and file http://www.example.com/arabic.php to actually handle the request behind the scenes, then simply write this code in the
.htaccessfile: