0
votes

How to activate URL Rewrite in my project. I installed URL Rewrite, I see it in my IIS

When I add a simple rule in my web.config file e.g. a rule just to remove default.aspx from the url or make url lower case

<configuration>

<system.web>
    <compilation debug="false" targetFramework="4.0" />
</system.web>
<system.webServer>

  <rewrite>
    <rules>
      <rule name="LowerCaseRule1" stopProcessing="true">
                <match url="[A-Z]" ignoreCase="false" />
                <action type="Redirect" url="{ToLower:{URL}}" />
      </rule>

      <rule name="Default Document" stopProcessing="true">
        <match url="(.*)Default.aspx" />
        <action type="Redirect" url="{R:1}" redirectType="Permanent" />
      </rule>

    </rules>
  </rewrite>
</system.webServer>
</configuration>

and when I run the project the rules don't work, please advice, thank you

1

1 Answers

0
votes

I haven't tried above code, but did that long before.

I always followed this http://www.iis.net/learn/extensions/url-rewrite-module/using-custom-rewrite-providers-with-url-rewrite-module

See if it helps you.