How to link files on network to MediaWiki

Well, here I am again with update on MediaWiki that I have installed and configured on GNU Linux Debian server ( see earlier posts) with Active Directory authentication to MS Small Business Server 2008. Now as we are progressing in use of he MediaWiki we needed to be able to create links to files or folders that are residing on the servers. In order to be able to create the link and be able to use the link to access the file or folder you need to add this to your LocalSettings.php file.

I have simply copied and pastes this into my LocalSetitngs.php file, exactly at the end of the file and saved it and restarted Apache.

# File Link Protocols configuration
$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:',
'file://',
'news:'
);

Once you have restarted the Apache server you can start using the link protocol to setup links to your files or folders on network. For example, I would like to include a shortcut to network schema document ( SchemaLAN.pdf) that is residing on my SBS server in IT folder. I would type in my MediaWiki text  this:

[file://\SBSITSchemaLAN.pdf]

This will create the “hot” link to the file in MediaWiki text.

Note: You will notice that the above will work just fine in Internet Explorer. However if you are using FireFox, Chrome or Opera nothing will happen when you click those links that you just created. The reason is that these browsers by default turn off the “file” protocol for security reasons. So far I have found just few notes that this is possible to enable in Firefox by editing the user.pref file for your profile. I will write next post on how and where to do this once I test out my configuration.

Recommended reading:

UPDATE: I was able to locate the Mozilla Firefox KB article that describes the issue to access local links from the browser and how to go around it to enable the access. Here is the KB. Here is what I have done in order to be able to access the links from MediaWiki in Firefox browser:

Note: my MediaWiki sits on mediaserver server

user_pref("capability.policy.policynames", "localfilelinks");
user_pref("capability.policy.localfilelinks.sites","http://mediaserver");
user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");

Once this is done, you will be able to access the links from Firefox browser. I do not know how to change it for other browsers and it seems to be pain to change for every user on the network 🙁