Online Chat
 Call Us: 
1-877-744-1221
Browse Submit a Ticket
 
Advanced Search
Tools
Rss Categories

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

Author: Edward Hardin Reference Number: AA-00470 Views: 97417 Last Updated: 08/15/2017 02:01 PM 0 Rating/ Voters

This guide describes how to enable URL rewriting feature on IIS7 server.

  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 in the wwwroot folder 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 those rewrite rules from 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