Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
2  
What is the wiki software? The software in use determines the text syntax. –  David Mackintosh Jun 2 '09 at 19:30
    
Sorry. Wikipedia. i thought wiki was synonymous with wikipedia's software. i can't really say "wikipedia", becuse that is the de-facto web-site that uses wiki software. –  Ian Boyd Jun 2 '09 at 19:58
    
i guess the proper name of the software is "WikiMedia" - what wikipedia uses. –  Ian Boyd Jun 2 '09 at 20:00
add comment

4 Answers

up vote 7 down vote accepted

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]

share|improve this answer
    
Thank you, that half of exactly what i need! –  Ian Boyd Jun 4 '09 at 17:19
    
A more portable way could be: $wgUrlProtocols[] = 'vmrc://'; which just "extends" the existing array. –  Michael Stum Jun 24 '10 at 17:13
    
adding to David's reply, you need to escape the blanks with %20 –  devio Feb 13 '11 at 21:21
add comment

I use pmwiki, they have a command so that when you encapsulate the text with [@ @] that it is printed as quoted and not changed into the wiki code - does that work for MediaWiki?

share|improve this answer
    
It does not work on MediaWiki, but i want to be clear. Does that turn your text into a hyperlink? Or does it output the text as is, but is not a link? When i try it, i literally get the square brackets and the @ signs. –  Ian Boyd Jun 2 '09 at 21:03
    
@ddrager In MediaWiki, use the <nowiki></nowiki> tags to keep MediaWiki from parsing the text. –  David Jun 3 '09 at 14:01
add comment

URLs are for pointing to resources not commands to be run.

You can link to a batch script (as mentioned above), or you can display the text in monospace, code form and let users copy & paste.

share|improve this answer
add comment

Sample to add url in mediawiki

[http://www.example.com/ Example Site] --> Output will be 'Example Site'
http://www.example.com --> output will be 'http://www.example.com'
share|improve this answer
add comment

protected by Michael Hampton Mar 9 '13 at 13:07

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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