亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

詳解angular部署到iis出現(xiàn)404解決方案

 更新時間:2018年08月14日 09:45:14   作者:WeihanLi  
這篇文章主要介紹了詳解angular部署到iis出現(xiàn)404解決方案,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

angular應(yīng)用部署在iis上,刷新出現(xiàn)404

解決方案:

安裝 iis URL Rewrite 模塊,配置urlrewrite如下:

在 src 目錄下增加web.config,內(nèi)容如下:

<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="/" />
   </rule>
  </rules>
 </rewrite>
</system.webServer>
</configuration>

配置 web.config 自動打包

修改 angular-cli.json文件(angular2-5)

 "apps": [
    {
    "root": “src”,
    "ourDir": “dist”,
    "assets": [
     “assets”,
     “favicon.ico”,
     “web.config”
     ],

修改 angular.json 文件(angular6)

    “build”: {
    "options”: {
     . . . 
     "assets": [
      “src/assets”,
      “src/favicon.ico”,
      “src/web.config”
       ],

Reference

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論