使用Angular UI路由html5Mode的IIS配置 [英] IIS configuration for using angular ui routing html5Mode

查看:87
本文介绍了使用Angular UI路由html5Mode的IIS配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用角度ui路由,但是由于最常见的问题原因,我想问一些问题.因为使用'#'主题标签,所以我更喜欢html5Mode属性.但是服务器端配置.是必需的.(

Im using angular ui-routing but for the most encountered problem reason I want to ask something. Because of using '#' hashtag I prefered html5Mode property. But server side conf. is needed.(https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-configure-your-server-to-work-with-html5mode) I m using IIS and I put the :

 <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="/" />
    </rule>
  </rules>
</rewrite>

并安装一个在stackoverflow上提到另一个主题的工具 (如何为IIS配置URL以HTML5模式重写AngularJS应用程序?).但是现在我得到了:HTTP错误403.18-禁止 无法在为Web服务器上为此资源配置的应用程序池中处理指定的请求.我真的将我的大部分时间用在主题标签问题上:(请帮助我.丢失了什么?

and install one tool which is mentioned another topic on stackoverflow (How do I configure IIS for URL Rewriting an AngularJS application in HTML5 mode?). But now I m getting : HTTP Error 403.18 - Forbidden The specified request cannot be processed in the application pool that is configured for this resource on the Web server.I m really spend my most of time for hashtag problem :( Please help me . What is the missing?

推荐答案

<match url=(.*)>
..
..
..
<action type="Rewrite" url="/{R:0}">

更改这两行,并尝试进行重写,因为重写应与向后资源兼容

Change these two lines and try as the rewrite should be backward resource compatible

这篇关于使用Angular UI路由html5Mode的IIS配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆