Tuesday, 19 May 2009

Apache 2 http directory listing encoding

As I implemented WebDAV server to share data sometimes I need to give users an HTTP link for WebDAV file or folders (the reason for that is that Windows XP clients can't open some file types, PDF for example, right from connections created in the Network Neighborhood). Everything work fine, exept that by default Apache generates file and folder listing using default encoding ISO-8859-1. In my case this is not appropriate: I need to publish files with Russian filenames. My collegue help me with this solution:
in file /etc/httpd/conf/httpd.conf add second line and comment the first
#IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable
IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8
Now I can get file and directory listing in right encoding. Thank you Lena!


Anonymous said...

Great. Works for me too :)

Anonymous said...

It doesn`t solved mine :(
I will try to explain it.
I have apache2, webdav and php5
I have also a php application (under apache2) that can list the folders we created previously on a webdav mapped drive from XP.
If I create the folder on the php site, I see that folder fine (with accents-spanish characters)but I cannot see it on the webdav mapped drive.

It's very strange and it's getting me mad because I have checked everything and I don't know what to do right now.

If you have any doubt I can tell you the username and password of the site four checking yourself ;)
Thx in advance.

kherio said...

If you can help me please don't hesitate to send me an email.

elke said...

What do you mean you cannot see it? Do you have problem with encoding of folders' names (or files' inside) which are created under php when you look at them on the mapped drive in XP? Which encoding do you use to create folders in php? Is it the same you use in webdav?
It sounds not like apache problem. Where do you see that folder fine? from site interface, from index tree in browser or from shell?

Vladimir said...

Great!! It's work for me now. Thanks!

Eugenius said...

Thanks a lot.

Anonymous said...

Thanks a lot ,It's work for me too!
Apache/2.2.10 (Linux/SUSE)Server