5

I have hosted my Angular 4 application in server system ,Initially I got 404 error So I have added a web.config file with my production build folder .Now I got this error.

But the app is running fine on my local system ,it throws error the server system.and I have tried some other systems which runs on win7,win10 but it's not running always shows the error of 500.19.

I spend hours to solve this ,referred all the post in in stackoverflow which related to my post but nothing is worked.

can anyone help me to solve this .

Error Page :

enter image description here

Web.Config

<configuration>
<system.webServer>
    <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="/eCommerceWebsite" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>
Vinil
  • 53
  • 1
  • 3

1 Answers1

19

Your IIS is missing URL Rewrite module.

You can download and install it here from microsoft: https://www.iis.net/downloads/microsoft/url-rewrite

penleychan
  • 5,370
  • 1
  • 17
  • 28
  • that issue is solved ,now it throws another issue "The 'Access-Control-Allow-Origin' header contains multiple values 'http://localhost, *', but only one is allowed. Origin 'http://localhost' is therefore not allowed access." @penlechann – Vinil May 31 '18 at 04:57
  • That's something to do with your API server. Not related to angular. – penleychan May 31 '18 at 05:06