zoukankan      html  css  js  c++  java
  • angular发布到iis

    1. 为IIS安装以下组件 

    短地址http://www.iis.net/extensions/URLRewrite

    下载页面https://www.iis.net/downloads/microsoft/url-rewrite#additionalDownloads

    下载链接https://download.microsoft.com/download/1/2/8/128E2E22-C1B9-44A4-BE2A-5859ED1D4592/rewrite_amd64_en-US.msi

    https://download.microsoft.com/download/1/2/8/128E2E22-C1B9-44A4-BE2A-5859ED1D4592/rewrite_amd64_zh-CN.msi

    2.  ng build后生成的 dist目录就是生成好的文件目录 可以直接使用

    3. dist目录根目录下添加web.config写入内容( rewrite 节点只有在安装了上面的组件后才能正常识别,否则 会一直报错说配置错误)

    <?xml version="1.0" encoding="utf-8"?>
    <!--
      有关如何配置 ASP.NET 应用程序的详细信息,请访问
      http://go.microsoft.com/fwlink/?LinkId=301880
      -->
    <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="/index.html" />
          </rule>
        </rules>
      </rewrite>
      </system.webServer>
    
    </configuration>
    

      

  • 相关阅读:
    勘测定界三调版发布
    混沌加密解密,附带完整C#源码
    c# 获取照片的经纬度和时间
    第8章代码
    使用Python读取照片的GPS信息
    6章代码
    python运行时间的两种方法
    5章代码
    在 ArcGIS 中使用的查询表达式的 SQL 参考
    15章代码
  • 原文地址:https://www.cnblogs.com/itstac/p/14886451.html
Copyright © 2011-2022 走看看