Manual:Short URL/IIS6

IIS6 and ShortURL support
Internet Information Services6 requires an ISAPI URL Rewrite filter to work. Several commercial filters are available. An open source ISAPI filter is available for free from http://www.codeplex.com/IIRF called Ionic's Isapi Rewrite Filter (IIRF). As of August 2007, IIRF version 1.2.12c is known to work with MediaWiki 10.1 using IIS6 under Windows Server 2003 SP1. It is likely that other IIS implementations are supported, as IIRF is also IIS 5.0 (Windows 2000) and IIS 5.1 (Windows XP) compatible.
 * Installation instructions are available from IIRF's website in the download package.
 * IIRF has a comprehensive forum providing install support.
 * To successfully configure IIRF, an INI file must be customized for MediaWiki. See below for details.

Sample INI file code for MediaWiki at wiki.domain.com/wiki/: (IsapiRewrite4.ini, stored in same path as IsapiRewrite4.dll) RewriteLog c:\temp\iirfLog.out RewriteLogLevel 3 MaxMatchCount 1 RewriteEngine On

RewriteCond %{HTTP_HOST} ^wiki.domain.com
 * 1) Change to suit your domain

RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d
 * 1) Checks for local file existance so that .css, .js and other MediaWiki files aren't processed

RewriteRule ^/wiki/(.*)$ /wiki/index.php?title=$1 [I,L] RewriteRule ^/wiki/Special:Search(.*)$ /wiki/index.php$1 [I,L] IterationLimit 4

(Alternate IsapiRewrite4.ini) RewriteLog c:\temp\iirfLog.out RewriteLogLevel 3 MaxMatchCount 10 RewriteEngine On

RewriteCond %{HTTP_HOST} ^wiki.example.com
 * 1) Change to suit your domain

RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d
 * 1) Checks for local file existance so that .css, .js and other MediaWiki files aren't processed

RewriteRule ^/wiki/Special:Search(.*)$ /w/index.php$1 [L] RewriteRule ^/wiki/(.*)$ /w/index.php?title=$1 [I,L] RewriteRule ^/wiki(//+)?$ /w/$1 [L] RewriteRule ^/*$ /w/ [L]

(Also edit your LocalSettings.php. Add this after $wgSitename) $wgArticlePath = '/wiki/$1'; # Virtual path. This directory MUST be different from the one used in $wgScriptPath $wgUsePathInfo = false;

// my $wgScriptPath = "/w";

Alternative
To Windows User who MUST use IIS servers,

IIS 5.x/IIS 6.0
IIS 5.x and 6.0 do not possess built-in rewrite yet. This means MediaWiki/IIS end-users shall continue to see ugly URLs (and not Apache's Short URL.)  An (extremely short) list of IIS ISAPIs that supports or adds rewrite capability.


 * Helicon Tech ISAPI / rewrite / ($)

ISAPI Rewrite 3 now looks to support Apache mod_rewrite syntax inside a .htaccess file. This means that many (if not all) of the guides here for Apache servers using mod_rewrite can work on IIS 5.x and 6.0 without having to modify the code at all if you have ISAPI rewrite 3 installed on your Windows server.

IIS 7.0
Just recently, IIS 7.0 now support rewrite capabilities. (Note: If you accomplish this installation, please edit this Short URL for IIS7 page.)