I converted a Drupal website to a static site using sitesucker (Mac tool). I am running MAMP 6 locally. Some images are missing live, probably because of an encoding issue.
For instance, I have this file:
Akzeptanz_GoA3+_Vorschaubild_Symbolbild_pexels-jéshoots-253647.jpg
And both locally and live it is embedded exactly like this:
<img src="/path/Akzeptanz_GoA3+_Vorschaubild_Symbolbild_pexels-je%CC%81shoots-253647.jpg">
Locally the image works, Live it is 404. What could be the reasons and possible solutions to this different behaviour? Live is a regular LAMP stack.
This behavior consists when I empty both htaccess files.
"Fixing" the URL encoding in the HTML source would be the preferred solution, as mentioned in comments (from
e%CC%81to%C3%A9). (Or even "normalising" the filename, so URL-encoding is not an issue.)However, if that is not an option then you could perhaps do a search/replace in
.htaccess.For example, near the top of the root
.htaccessfile:Include a
/path/in theRewriteRulepattern (as above) to limit the number of URLs tested.We match (and capture) the requested URL in the preceding condition against
THE_REQUESTserver variable, which preserves the URL-encoded URL that was actually requested.The literal
%in the substitution string should be backslash-escaped to avoid potentially being interpreted as a backreference (although since they are not followed by a digit, that should be OK).Chrome will often show the more friendly URL-decoded URL in the address bar, even if the underlying request is URL-encoded.
When you change it in the
srcattribute (to the URL-decoded version I assume) then the browser automatically "fixes" it and URL-encodes the URL in the HTTP request (you can examine the Network traffic in the browser dev tools).