Mobile app version of vmapp.org
Login or Join
BetL925

: How do you hot link an external image from a Media Wiki site? 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

@BetL925

Posted in: #Hotlinking #Images #Mediawiki

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">

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @BetL925

2 Comments

Sorted by latest first Latest Oldest Best

 

@Fox8124981

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

The correct way to insert an external image into a wikimedia page is 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.

10% popularity Vote Up Vote Down


 

@Ann8826881

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):

www.mediawiki.org/wiki/Manual:LocalSettings.php http://www.mediawiki.org/wiki/Manual:Configuration_settings www.mediawiki.org/wiki/Manual:$wgAllowExternalImages http://www.mediawiki.org/wiki/Manual:$wgAllowExternalImagesFrom www.mediawiki.org/wiki/Manual:$wgEnableImageWhitelist

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme