I have a shared hosting account and I am using Filezilla to connect to the server.
Under the public_html/items/ folder, there are many subfolders and their folder names are encoded using PHP rawurlencode function, like these:
apple
banana
orange
%E6%BC%A2%E5%A0%A1%E9%A3%BD
%E8%96%AF%E6%A2%9D
The problem is that I get 404 error when I access the files under the folders whose names contain non-ASCII characters (e.g. chinese characters).
This means I can access URL like this one:
http://my-domain.com/items/apple/index.html
But not:
http://my-domain.com/items/%E6%BC%A2%E5%A0%A1%E9%A3%BD/index.html
What kind of a problem could this possibly be?
Many thanks to you all.
If the folders contain physically urlencoded names, then you’ll need to ensure these names are themselves urlencoded in your urls. In fact, anytime you create a URL from any ‘uncontrolled’, potentially url-unsafe elements, you must urlencode those elements.
Thus if you have a directory named
%E8%96%AF%E6%A2%9DYou would refer to it in a URL with
%25E8%2596%25AF%25E6%25A2%259DPretty, isn’t it?
Another way of looking at this is that when you use your existing urlencoded URL, what the server actually tries to resolve is /items/漢堡飽/index.html