使用angular ui路由html5Mode的IIS配置 [英] IIS configuration for using angular ui routing html5Mode
问题描述
我使用 angular ui-routing 但对于遇到的最常见问题的原因,我想问一些问题.由于使用 '#' 标签,我更喜欢 html5Mode 属性.但是服务器端conf.需要.(https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-configure-your-server-to-work-with-html5mode)我正在使用 IIS,我把 :
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 以在 HTML5 模式下重写 AngularJS 应用程序的 URL?).但现在我得到: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屋!