Manual:$wgUploadMissingFileUrl/en

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

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

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