开发者

app_offline on IIS7 with PHP

I'm running PHP on my IIS 7 Server and I would like to get something similar to the ASP.NET app_offline.htm functionality. Just putting app_offline into the directory did not work. Maybe there is a good rewrite rule that would just forward all requests to app_offline? My first try resulted into a redirect loop, so not sure what I did wrong.

<rule name="Offline" enabled="false" patternSyntax="Wildcard" stopProcessing开发者_如何学运维="true">
<match url="*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="app_offline.html" appendQueryString="false" redirectType="Temporary" />
</rule>

Any ideas?


I guess I found a solution, don't think it's pretty, but it works:

<rule name="Offline" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
  <match url="^(?:(?!app_offline).)*$" />
  <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
  <action type="Redirect" url="app_offline.htm" appendQueryString="false" redirectType="Temporary" />
</rule>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜