URL with accent does not work

Alles, was den Apache betrifft, kann hier besprochen werden.

URL with accent does not work

Postby julos08 » 04. August 2014 10:06

Hello All,

I am front of an issue with my new server with Apache. The url with accent does not work and I receive a 404 error page if I try to load a picture with an accent in the name.
Ex: I type the url in my web browser http://mywebiste/Légende.jpg and a 404 error page is openning to tell me that the URL http://mywebiste/Légende.jpg cannot be found.
The é character has been replaced by é.
If I upload an image with an accent from my CMS as Joomla, the image Légende.jpg becomes Légende.jpg in the server and can be read via the web browser.

With my old server under Gentoo I did not have this problem.
Now with my new server under Centos 6 and directadmin, all websites with images with accents have the same problem.

Do you know if I can solve that?

Thanks in advance.
julos08
 
Posts: 3
Joined: 04. August 2014 09:48
XAMPP Version: 1.8.0
Operating System: Centos 6

Re: URL with accent does not work

Postby Nobbie » 04. August 2014 16:59

julos08 wrote:Do you know if I can solve that?


Simply do not use special characters like accent etc. in filenames. Rename the file to Legende.jpg for example and use that name. Browsers very often use different character tables than the Operating System for such special characters, therefore it is not recommended to use this in URLs.
Nobbie
 
Posts: 6917
Joined: 09. March 2008 13:04

Re: URL with accent does not work

Postby julos08 » 04. August 2014 19:33

Hello Nobbie,

Of course but do you know if it's possible to change the configuration to authorize the special character?
julos08
 
Posts: 3
Joined: 04. August 2014 09:48
XAMPP Version: 1.8.0
Operating System: Centos 6

Re: URL with accent does not work

Postby Nobbie » 05. August 2014 09:24

julos08 wrote:Of course but do you know if it's possible to change the configuration to authorize the special character?


It is not a question of "authorize", it is a question of

a) which browser you are using
b) which character codes your HTML and your Apache are using
c) which character codes your filesystem uses
d) which character codes are used for MySQL Database and Driver

If (for example) the character code of your file system has changed (due to the different OS, for example utf16 instead of latin1), the filename is stored with a wrong character code in your Joomla database. This is quite an ugly problem, therefore it is not recommended to use special chars in filenames.

I am sorry, but it is hard to help you out of this, you should find out which character sets had been involved in the old environment and compare it to the new environment. This may also effect the MySQL Database itself and the MySQL Driver. If any component has changed, your are in big trouble.
Nobbie
 
Posts: 6917
Joined: 09. March 2008 13:04

Re: URL with accent does not work

Postby julos08 » 05. August 2014 11:08

Problem solved.

Many thanks to gave me the way.
I just change the locale LANG in CENTOS and apache from en_US to en_US.utf8 and now it's working fine.
Files to change : /etc/sysconfig/i18n and /etc/init.d/httpd

I hope that will help other people.
julos08
 
Posts: 3
Joined: 04. August 2014 09:48
XAMPP Version: 1.8.0
Operating System: Centos 6

Re: URL with accent does not work

Postby Nobbie » 05. August 2014 17:05

Very good, my congratulation. This usually is a nasty problem.
Nobbie
 
Posts: 6917
Joined: 09. March 2008 13:04


Return to Apache

Who is online

Users browsing this forum: No registered users and 3 guests