Manual:$wgUploadMissingFileUrl

Usage
Use this setting to point wikilinks to missing files ("red file links") to a custom URL, as with. The URL will get appended to it as appropriate.

If false, the value of is used. If that too is false, Special:Upload is used.

was used before this setting (1.16 and below), and will be used if  is not defined (from  onwards). For 1.17 and 1.18 you have to set.