Commits

Dan Carroll  committed cb9253a

Make Web.config no-www redirect generic

  • Participants
  • Parent commits 32e6457

Comments (0)

Files changed (1)

File content/Web.config

     <system.webServer>
         <rewrite>
             <rules>
-                <rule name="Canonical Hostname">
+                <rule name="Canonical Hostname" stopProcessing="false">
                     <match url="(.*)" />
                     <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
-                        <add input="{HTTP_HOST}" pattern="^dancarroll.org$" negate="true" />
+                        <add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" />
                     </conditions>
-                    <action type="Redirect" url="http://dancarroll.org/{R:1}" redirectType="Permanent" />
+		    <action type="Redirect" url="http://{C:2}{REQUEST_URI}" redirectType="Permanent" />
                 </rule>
                 <rule name="Convert to lower case" stopProcessing="true">  
                     <match url=".*[A-Z].*" ignoreCase="false" />