Manual talk:Short URL/IIS6

From mediawiki.org
Latest comment: 15 years ago by 144.223.18.102 in topic Another Way

My Way[edit]

To get pretty URLs on my wiki, I first of all added the settings to the LocalSettings.php (Manual:Short_URL#Guide) 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)Reply

Another Way[edit]

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.

  • 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)
    • $wgScriptPath = '/w'; # Path to the actual files. This should already be there
    • $wgArticlePath = '/wiki/$1'; # Virtual path. This directory MUST be different from the one used in $wgScriptPath
  • IsapiRewrite4.ini:
RewriteLog  c:\temp\iirfLog.out
RewriteLogLevel 3
MaxMatchCount 1
RewriteEngine On

# Change to suit your domain
#RewriteCond %{HTTP_HOST} ^wiki.domain.com

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

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)Reply