Thread:Project:Support desk/500 Internal Server Error after Migration/reply (25)

> GET http://192.168.1.162/mediawiki/images/sample.tar.gz

Really? You type the URL with the numbers in it and the first and only request goes to the URL without these numbers? You get no redirect? I expected the request to start with status code 301 or 302 and then the new URL would be called. That is weird! If that really was the case, then it would mean that - before the server is queried for the first time - the browser would change the URL. I cannot believe that that is happening.

Basically I guess that you need this logic in the nginx configuration: In the folder images/, if a file in the second level of subfolders is requested (URL contains the according number of path segments separated by slashes) and if the file is not there, then redirect to the same URL, but without these two path segments.

Apache config would be something like this:

RewriteCond %{REQUEST_FILENAME} !-f RewriteRule images/[0-9a-zA-Z]{1}/[0-9a-zA-Z]{2}/.* images/$1 [L]

Untested, might not yet be working. In words: Only do the following rewrite, if the requested filoe is not present. Then: Rewrite, if the called path contains "images/", then one alphanumerical character, a slash, then two alphanumerical characters and a slash and then "any string". If so, then rewrite to "images/" and append the things that were there before ("any string").

Maybe you can use this website from above to transform it into Nginx configuration.