8

What is the syntax for showing an externally hosted image in a media wiki page? The media wiki help page doesn't seem to cover that scenario.

I've tried several things that don't work:

[http://example.com/image.jpg]
[[File:http://example.com/image.jpg]]
<img src="http://example.com/image.jpg">
8

Your example [http://example.com/image.jpg] is correct.

You will need to enable this by setting $wgAllowExternalImages to true in your configuration file. The default is false. Optionally, you can set $wgAllowExternalImagesFrom to allow exceptions while $wgAllowExternalImages remains set to false. You can also use $wgEnableImageWhitelist to allow exceptions based upon regular expressions.

You will likely need to copy the appropriate line from DefaultSettings.php to LocalSettings.php.

Here are some links (in order):

2

Actually, [http://example.com/image.jpg] is not correct.

The correct way to insert an external image into a wikimedia page is http://example.com/image.jpg eg. no square brackets.

Of course, make sure that you have added $wgAllowExternalImages = true to your configuration file to enable display of the image, as wikimedia defaults to not allowing externally hosted images.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.