Nagendra Kumar
Nagendra Kumar

Reputation: 654

Web.Config File is not able to load in Angular Application

I need some help in Deployment of Angular Application on local IIS Server .

ISS version : 10

i have deployed my Angular Application on IIS and its working fine but when i am adding web.config file in it then its giving Error . local Host URL is : http://localhost/eportal . URL rewrite extension is also installed .

when adding this config file then Application Gives error .enter image description here

Here is Web Config File

<?xml version="1.0" encoding="UTF-8"?>
    <configuration>

      <system.webServer>
        <rewrite>
          <rules>
            <rule name="Angular Routes" stopProcessing="true">
              <match url=".*" />
              <conditions logicalGrouping="MatchAll">
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
              </conditions>
              <action type="Rewrite" url="/eportal">
            </rule>
          </rules>
        </rewrite>
      </system.webServer>

    </configuration>

Upvotes: 0

Views: 9681

Answers (1)

Rohit.007
Rohit.007

Reputation: 3502

I guess, you need to provide the file name in the action url and your action type tag is not closed in xml

e.g.

<?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.webServer>
        <rewrite>
          <rules>
            <rule name="AngularJS" stopProcessing="true">
              <match url=".*" />
              <conditions logicalGrouping="MatchAll">
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
              </conditions>
              <action type="Rewrite" url="/eportal/index.html" />
            </rule>
          </rules>
        </rewrite>
      </system.webServer>
    </configuration>

Upvotes: 2

Related Questions