Angular Routing in Windows Shared Hosting

In Windows Shared hosting we have to create “web.config” file to support Angular routing. The file content would be similar to this –

        <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" />
          <action type="Rewrite" url="/" />
    <compilation tempDirectory="X:\INETPUB\VHOSTS\<HOST_NAME>\tmp" />

You have to get the actual path of tempDirectory from your server and have to change it accordingly –

“<compilation tempDirectory=”X:\INETPUB\VHOSTS\<HOST_NAME>\tmp” />”

After creating/ updating this file please make sure you restart your IIS server or similar action need to perform from your shared hosting server.

Related posts:

Leave a Reply

Your email address will not be published. Required fields are marked *