Tuesday, March 5, 2013

URL Rewrite Rules

Prep Web.config like so in order to make a URL Rewrite rule. This one empowers swapping from one language to another in an app I am working on.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <system.webServer>
      <modules runAllManagedModulesForAllRequests="true" />
         <rewrite>
            <rules>
                <rule name="G11N Rule" stopProcessing="true">
                   <match url="^OnlyThisFolderAndItsChildren/.*" />
                   <action type="Rewrite" url="g11n.aspx?{R:0},
                        E:\inetpub\wwwroot\whatever\" appendQueryString="false" />
                </rule>
            </rules>
         </rewrite>
   </system.webServer>
</configuration>

 
 

If you click on a site in IIS, "URL Rewrite" should appear as a module for the site. The modules seem to be categorized into ASP.NET, IIS, and Management and this module appears in the IIS subsection.

No comments:

Post a Comment