MediaWiki Code Modifications

   MediaWiki Code Modifications

This page contains making MediaWiki Code Modifications to add or remove functionality.

File Uploads
File uploads are disabled by default with MediaWiki. To enable them, first set the upload directory permissions to 777: /images/           (folder)

Then edit  and set uploads to true:

You can add to $wgFileExtensions to allow uploads of any type of file you like. If not included then the $wgFileExtensions line would look something like or


 * See MediaWiki Manual:Configuring File Uploads.
 * See MediaWiki: Uploading non image files
 * See MediaWiki: Mime type detection.
 * Note: If you decide to allow any kind of file, make sure your mime detection is working and think about enabling virus scans for uploads.

External Images
Displaying external images is disabled by default with MediaWiki. To enable them edit : To display an image use just insert the image's url:

Example: http://wiki.dansalmon.info/skins/common/images/fishcakes-logo-mediawiki.png

Category Automation
We all like to keep our wikis tidy. This is a little system that shows every user what to copy and paste into their pages to include it in the right category. '''Please copy and paste the following into the end of your article to include it in this category:'''
 * 1) Create a new template by visiting http://www.yourdomain.com/wiki/Template:Putincategory
 * 2) Paste the following into it and save:
 * 1) Upload the alert image [[Image:Icon_Alert_Green_40px.png]] to your wiki.
 * 2) On every category page, simply paste the following:

Search Engine Friendly URLs
To create SEF or Short URLs do the following:

1. Edit the file. Remove or comment out any definitions for $wgArticlePath, then add the following line somewhere near the definition of $wgScriptPath:

2. Edit the file. Add the following code: RewriteEngine On RewriteRule ^[^:]*\. - [L] RewriteRule ^[^:]*\/ - [L] RewriteRule ^/*$ /index.php?title=Main_Page [L,QSA] RewriteRule ^(.+)$ /index.php?title=$1 [L,QSA]
 * 1) Search Engine Friendly Short URLs

See also MediaWiki: Short URLs and MediaWiki: Short URLs No Root Access.