Topic on Project:Support desk

File:FileName generates incorrect URL (file://filename)

4
196.24.216.2 (talkcontribs)

I've migrated and upgraded an old mediawiki to 1.35.8 and am now fixing up the configuration. The content loads but file links aren't working properly (they are working on the old wiki). For example, [[File:Monitor_Code_Block.jpg]], does not show the file and instead creates a url file://Monitor_Code_Block.jpg, instead of the correct URL. I've tried running php maintenance\rebuildall.php but that didn't help. The files were copied to the upgraded wiki in the images folder. $wgScriptPath, $wgUploadPath and $wgServer seem to be set correctly.

196.24.216.2 (talkcontribs)

To expand on what I do see, the image replaced with a citation looking like "[[3]], where the inner [3] is a URL pointing to "file:dcom_.png" in this example (not even a valid file URL in fact). I've tried running php maintenance\refreshImageMetadata.php, but that didn't help either.

Bawolff (talkcontribs)

Do you have $wgUrlProtocols set to something other than its default in LocalSettings.php? If so, what is it set to?

196.24.216.2 (talkcontribs)

Thanks, that was the problem! It included 'file:'. Changing that to 'file://' fixed my problem as per the bug description in your link.

Reply to "File:FileName generates incorrect URL (file://filename)"