I am trying to build an Angular JS app with URL rewriting. When I go to localhost:50717 I want the page to automatically take me to my route.html file which is at localhost:50717/route.html. Yet when I go to this base directory I don't go to the page but to the base directory even when my web.config file should be rewriting.

Funny thing is that it URL rewrites just fine when I go to localhost:50717/courses to go to one of my views. I have URL rewriting installed on IIS and that part is working correctly.

My web.config file has the code:

<directoryBrowse enabled="true" />
<rewrite>
  <rules>
    <rule name="RewriteRules" stopProcessing="true">
      <match url=".*" />
        <conditions logicalGrouping="MatchAll">
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
        <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
      </conditions>
      <action type="Rewrite" url="/route.html" />
    </rule>
  </rules>
</rewrite>

I previously had a much worse issue with the URL rewriting of the Angular routes not working but that has been resolved. Now I just need the base URL to get me to that file. Here is the previous resolved issue: URL Rewrite for AngularJS not working in ASP.NET

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.