Online Chat
 Call Us: 
1-877-744-1221
Browse Ask a Question
 
Tools
Rss Categories

Installation of native URL Rewriting module (URL Rewrite) for IIS7

Author: Edward Hardin Reference Number: AA-00470 Last Updated: 10/21/2011 10:53 AM 0 Rating/ Voters

This guide describes how to enable URL rewriting feature on IIS7 server (if you need this feature on IIS6, follow the Installation of URL Rewriting module (IIRF) for IIS6/IIS7 guide)

Warning

If you're using Helicon ISAPI Rewrite, you do not need to install any other URL rewrite software. KMP works with this module from the box.

If you're already using IIRF (Ionic ISAPI Rewrite), you can just add necessary configuration according to the guide for IIS6 (it also works for IIS7).

If you're already using some other URL Rewrite tool, we strongly recommend to completely uninstall it, because it may interfere with native URL Rewriting module for IIS7 and it is most likely that URL rewriting will not work correctly, and KMP may be inaccessible even if you follow the instructions in this article carefully.

  1. Download and install URLRewrite version 1.1 or 2. Installation is fast and simple.
  2. Open the IIS manager and check that URL Rewrite is installed.



  3. Edit the web.config file and add four rewrite rules for KMP to the <system.webServer> section. 

    Rewrite Rules for web.config

     <rewrite>
                <rules>
                    <clear />
                    <rule name="Rule 1" stopProcessing="true">
                        <match url="^kmp/hosts/hosted/(.*)$" ignoreCase="false" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="/kmp/hosts/hosted/index.php?/{R:1}" appendQueryString="false" />
                    </rule>
                    <rule name="Rule 2" stopProcessing="true">
                        <match url="^kmp/hosts/preview/(.*)$" ignoreCase="false" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="/kmp/hosts/preview/index.php?/{R:1}" appendQueryString="false" />
                    </rule>
                    <rule name="Rule 3" stopProcessing="true">
                        <match url="^kmp/admin/(.*)$" ignoreCase="true" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="/kmp/admin/index.php?/{R:1}" appendQueryString="false" />
                    </rule>
                    <rule name="Rule 4" stopProcessing="true">
                        <match url="^kmp/(.*)$" ignoreCase="true" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="/kmp/index.php?/{R:1}" appendQueryString="false" />
                    </rule>
                </rules>
            </rewrite>


    Check Path to KMP

    Please note that the example above works for KMP installed to the "kmp" folder under the web root. If you have installed KMP to another folder, you need to change the highlighted values accordingly (there are 8 of them).

  4. You can download an example of web.config file with the aforementioned rewrite rules in the Attachments section below.
  5. Open the URL rewrite tool from your website page in IIS Manager and check that all rules have been added successfully.



  6. Go to Styling and Front-end Settings to switch URL Rewriting ON and save the new settings:

  7. Open a front-end page in your browser to check if URL Rewrite works correctly now.

Attachments
webconfig.zip 527 b Download File