以前,我使用的是URL重写。
1)http://example.com/:重写根url
<rule name="PC rewrite main" enabled="true" stopProcessing="true">
<match url="^$" ignoreCase="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="^(www.)?example.(net|com)$" />
</conditions>
<action type="Rewrite" url="/main/default.asp" appendQueryString="true" />
</rule>
2)http://example.com/product/12345:产品网址重写
<rule name="Product PC" stopProcessing="true">
<match url="^product/([0-9]+)*\/?$" />
<action type="Rewrite" url="/goods/detail.asp?gno={R:1}" appendQueryString="false" />
</rule>
工作正常,但是我应用了https,重定向过多。
3)https
<rule name="HTTP to HTTPS Redirect" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="^off$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
</rule>
我不知道怎么了。请让我知道