Manual talk:Short URL/IIS6

My Way
To get pretty URLs on my wiki, I first of all added the settings to the LocalSettings.php (Manual:Short_URL) and then added the configuration found here to my Iconic Rewrite file, however I changed:

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

to

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

since it looked like that could conflict, rewriting to the same directory that the wiki files are physically located in.

Hopefully someone will update the IIS6 page on my behalf. --81.149.184.29 01:49, 23 March 2008 (UTC)

Another Way
I could not for the life of me get either of these ways (above and main article) to work. The main article works but not for searches (the 2nd rule is a subset of the first rule and therefore will never get evaluated). If i moved the 2nd rule above the first rule, the first rule would no longer run properly (for whatever reason which is beyond me). Here is what finally worked for me.

RewriteLog c:\temp\iirfLog.out RewriteLogLevel 3 MaxMatchCount 1 RewriteEngine On
 * media wiki installed to C:\path\to\mediawiki\w
 * the root directory is named w
 * added the following to the bottom of LocalSettings.php (ADDING $wgUsePathInfo caused problems)
 * IsapiRewrite4.ini:
 * IsapiRewrite4.ini:
 * IsapiRewrite4.ini:


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

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/$ /w/index.php [I,L] RewriteRule ^/wiki/Special:Search(.*)$ /w/index.php$1 [I,L] RewriteRule ^/wiki/(.*)$ /w/index.php?title=$1 [I,L]

IterationLimit 4

searching an short urls now work properly.

btw, when moving the search rule above the article rule, the article rewrite worked for the most part (content was loaded) but looked as though no styling was applied (maybe fails to load css and js files?) Not sure why $wgUsePathInfo was causing problems, but it would rewrite /wiki/W/index.php instead of /wiki/Main_Page

144.223.18.102 22:34, 23 May 2008 (UTC)