Manual:Short URL/wiki/Page title -- Windows with IIS7--root access

=Pretty URLs with Windows IIS7/7.5=


 * 1) Install IIS URL Rewrite Module
 * 2) Modify LocalSettings.php
 * 3) Create a Rewrite/Redirect rule
 * 4) * Create an Inbound and Outbound rule set
 * 5) * Sample web.config
 * 6) * Basics of Creating IIS Rewrite/redirect rules

Install IIS URL Rewrite Module 2.0

 * 1) Download appropriate 32bit or 64bit IIS Rewrite Module from Microsoft:
 * 2) * (x86): 32bit Rewrite Module from Microsoft (Version 2: download)
 * 3) * (x64): 64bit Rewrite Module from Microsoft (Version 2: download)
 * 4) Install on the host server by running the downloaded .msi file

Modify LocalSettings.php
Edit the appropriate path configurations in your LocalSettings.php file:
 * $wgScriptPath = "/w"; # The directory under your document root where MediaWiki is installed
 * $wgArticlePath = "/wiki/$1"; # This is the rewritten URL
 * $wgUsePathInfo = true;

Create an Inbound and Outbound rule set

 * 1) Open Internet Information Services Manager
 * 2) Select your wiki site from the website list
 * 3) Open the URL Rewrite Control from the IIS group
 * 4) Click on "Add Rule(s)..."
 * 5) Select the "User-Friendly URL" template
 * 6) Enter  http://www.example.com/wiki/index.php?title=Main_Page 
 * 7) Select  http://www.example.com/Main_Page  from the drop down
 * 8) * There IIS Rewrite template doesn't support customizing through this window, we will get to a clean up step
 * 9) Check both of the following options:
 * 10) * Create corresponding redirect rules
 * 11) * Create corresponding outbound rewrite rule
 * 12) Click OK
 * 13) Open the web.config file that appears in the site root directory
 * 14) Change the following
 * 15) * FROM: 
 * 16) * TO: 


 * rules based on IIS7.5

Sample Web.Config
This is a sample web.config file that contains rules based on the above. There is a second entry other then the rules. The httpRedirect handles making sure that any request to:  http://www.example.com/  is directed to  http://www.example.com/wiki/ . This allows mediaWiki to pick up and run with any additional redirects.

Mediawiki is implemented in short path under windows iis7
Because I can't speak English, so please see a friend who helps me to translate. Be sure to translate, because the methods provided above cannot be used, at least my local and network tests have failed. If the search function does not match.

And the new method I provided below tested successfully on mediawiki1.25:

Added at the bottom of LocalSettings.php:

$wgArticlePath = $wgScriptPath. "/$1";


 * Create new web.config and write it inside (web.config requires Url_Rewriter support):


 * If there is an error when uploading a picture after use (I don't have this situation):



Change to




 * After use: Home page, content page, list page, search function, special page, picture display, etc. are all displayed normally.

Iis UrlRewriter special character link causes 404 error resolution
For example, I will not publish rules on Wikipedia articles.

If a special symbol such as a + (plus sign) in the URL results in a 404 error, we wrote the solution: % E5%AD%97%E7%AC%A6%E7%9A%84%E9%93%BE%E6%8E%A5%E8%A7%A3%E5%86%B3%E6%96%B9%E6 % B3%95 Iis UrlRewriter special character link solution article.

Everyone can modify their own web.config content to solve this problem.