Skip to content
This repository was archived by the owner on Nov 1, 2018. It is now read-only.
This repository was archived by the owner on Nov 1, 2018. It is now read-only.

Issue: URL Rewrite using web.config is broken in RC2 #192

Closed
@anwalkers

Description

@anwalkers

I have tried moving the web.config to and fro and cannot get the URL rewrite to work in IIS Express from Visual Studio 2015. If there was middleware to perform what is spelled out in the web.config snippet I could punt on the web.config and selfhost. Maybe someone can point me in that direction to solve our problem.

We need to use Angular 1.x HTML 5 routing in our application and this is how we had solved it in RC1 but it doesn't work in RC2. Others are having trouble as well: http://stackoverflow.com/questions/37304113/url-rewriting-in-asp-net-core-rc2#

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
    <rewrite>
      <rules>
        <rule name="AngularJS Routes" 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="/" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions