0

we are about to move our companies Website (Drupal 7) from the old Server A to the new Server B. As usual we ex-/imported the database and copied all the files via ftp.

Since our company resides in Germany, we have a bunch of Images whose File names contain german Umlauts. The CMS correctly URL-encodes their URI so that an existing file like über uns.jpg is represented with such a markup:

<img src="http://<path to file>/%C3%BCber%20uns.jpg" />

This very process is working on Server A and B, BUT Server B responds with a 404 Not Found, for the exact same path, for which Server A returns the image.

Both Servers use a standart »Lamp« setup, whereby Server B's Software is up to Date (Apache 2.4, PHP 7.0) and Server A's quiete old (~5 Years).

I appreciate any help and thanks in ahead!

philipp
  • 137
  • 2
  • 10
  • Do both servers use the same locale or is one using `latin1` and one `UTF-8`? – Sven May 17 '16 at 09:20
  • Good question! Whch locale Setting? Of the OS, the Apache, the database, or the php? – philipp May 17 '16 at 10:10
  • The OS first. Is the file name `über uns.jpg` coded the same on both machines, e.g. do they appear the same if you do an `ls`? – Sven May 17 '16 at 10:11
  • It remains a good Question! We have FTP access to server A only, but we can access Server B via SSH. I will call the provider… – philipp May 17 '16 at 10:22

1 Answers1

3

This one really drove me nuts! I doubled checked each and every possible locale setting and found out that each of them was set to UTF-8.

The strangest thing was: Copy/Pasting the url to the address bar of a browser brought the 404. But typing the very same address without pasting from the source returned the image. In sublime Text I had »both« urls (the pasted and the typed) in one file, marking the first and hitting Ctrl-D did not select the other, so the urls were not the same and I guess that there was some trouble in byte order, but that is just guessing.

So the reason why is still unclear to me, but I can tell how I fixed it: I fired up FileZilla, downloaded the files directory to my local computer and used this to upload and override. That was it.

My colleague who initially down- and uploaded all the files stored them on the internal Mac based Server before uploading and I guess that this step somehow messed up the files, but again, this is just guessing.

philipp
  • 137
  • 2
  • 10
  • I know this is an old question. But for anyone coming here from google... The encodings are correct. The string is different though. For example both o%CC%88 and %C3%B6 becomes an "ö" encoded. o%CC%88 is same as o + ¨ = ö the %C3%B6 is just an ö. This is giving me issues too, but I think your solution could work for me too, so thanks a lot for sharing :) – galengodis Aug 29 '21 at 22:40