How to add URL’s to wiki (MediaWiki) powered documentation

mediawikiurlvirtualizationwiki

We have an internal company wiki. The wiki engine being used is MediaWiki, the wiki engine that runs Wikipedia. Some of it contains IT stuff.

One of the things i want want to have are hyperlinks to the various virtual machines. An example of a command, as it needs to run, is:

vmrc://solo.avatopia.com:5901/Windows 2000 Server

My first thought was to convert the URL into a link:

[vmrc://solo.avatopia.com:5901/Windows 2000 Server]

But the content renders literally as above: with the square brackets and all. Testing with other URL protocols:

[http://solo.avatopia.com]
[ftp://solo.avatopia.com]
[ldap://solo.avatopia.com]
[vmrc://solo.avatopia.com]

Only the first two work, and are converted to hyperlinks. The other two remain as liternal text. How can i add URLs to MediaWiki powered documentation?


Original Question

We have an internal company wiki. The wiki engine being used is MediaWiki, the wiki engine that runs Wikipedia. Some of it contains IT stuff.

One of the things i want want to have are hyperlinks to the various virtual machines. An example of a command, as it needs to run, is:

\\solo\VMRC Client\vmrc.exe solo.avatopia.com:5901/Windows 2000 Server

If launching from a command prompt, you have to quote the spaces:

C:\>"\\solo\VMRC Client\vmrc.exe" solo.avatopia.com:5901/"Windows 2000 Server"

My first thought in converting the above for use on our wiki-site, is to simply HTML-ify it:

file://\\solo\VMRC Client\vmrc.exe solo.avatopia.com:5901/"Windows 2000 Server"

but MediaWiki only converts file://\solo\VMRC to a hyperlink, the remainder is text.

i've tried other random things, including enclosing the URL in square brackets.

What is the correct answer? i don't want to happen to randomly stumble on some format that happens to work today, and breaks in the future.

Best Answer

The protocols (http, ftp, gopher, etc) which turn into links when surrounded by square brackets ([]) are defined in the $wgUrlProtocols array in your LocalSettings.php file. Here are the default protocols allowed.

$wgUrlProtocols = array(
    'http://',
    'https://',
    'ftp://',
    'irc://',
    'gopher://',
    'telnet://', // Well if we're going to support the above.. -ævar
    'nntp://', // @bug 3808 RFC 1738
    'worldwind://',
    'mailto:',
    'news:'
);

To fix your problem, add vmrc as a protocol. Add/replace the following in your LocalSettings.php file:

$wgUrlProtocols = array(
    'http://',
    'https://',
    'ftp://',
    'irc://',
    'gopher://',
    'telnet://', // Well if we're going to support the above.. -ævar
    'nntp://', // @bug 3808 RFC 1738
    'worldwind://',
    'mailto:',
    'news:',
    'vmrc://',
);

You can now create links using the square bracket syntax: (The URL comes first, separated from the link text by one space. Spaces are not allowed in the URL.) [vmrc://solo.avatopia.com:5901 Windows 2000 Server]

Related Topic