我试图从形式重写URL:从https重写URL://到http://在IIS7
https://example.com/about
的形式
http://example.com/about
<!-- http:// to https:// rule -->
<rule name="ForceHttpsBilling" stopProcessing="true">
<match url="(.*)billing/(.*)" ignoreCase="true" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="false" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}{REQUEST_URI}" />
</rule>
<!-- https:// to http:// rule -->
<rule name="ForceNonHttps" stopProcessing="true">
<match url="(.*)billing/(.*)" ignoreCase="true" negate="true" />
<conditions>
<add input="{SERVER_PORT}" pattern="^443$" />
</conditions>
<action type="Redirect" redirectType="Found" url="http://{HTTP_HOST}{REQUEST_URI}" />
</rule>
我不知所措;我一直在浏览网页的例子,并尝试我能想到的每一种语法。对于任何https请求,我所指定的重写规则根本不会工作,全部为,好像所有的https://
请求对于重写引擎都是不可见的。
规则正常工作;见下面的答案。
对我来说,气味就像一个基本的安全'功能' – 2009-10-08 08:05:02
这对我来说就像一个服务器故障问题... – 2009-10-08 08:47:02
@Charlie,no。这是编码和管理问题之一,所以请将其留在它开始的网站上(如很多脚本问题) – 2009-10-08 10:18:54