Redirect Web配置| 302重定向将url加倍
我正在使用302从外部域重定向:Redirect Web配置| 302重定向将url加倍,redirect,iis,web-config,http-status-code-302,Redirect,Iis,Web Config,Http Status Code 302,我正在使用302从外部域重定向: <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <httpRedirect enabled="true" destination="https://www.example.com" httpResponseStatus="Found"> <clear />
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpRedirect enabled="true" destination="https://www.example.com" httpResponseStatus="Found">
<clear />
</httpRedirect>
</system.webServer>
</configuration>
我已经尝试了很多版本的302重定向,但似乎目标域中的url翻了一倍。。发生这种情况的原因是什么?尝试将
exactDestination=“true”
添加到
元素:
。否则,IIS会将重定向视为相对于尝试的路径。它返回https://www.example.com%2Chttp//www.example.com
尝试将exactDestination=“true”
添加到
元素:
。否则,IIS会将重定向视为相对于尝试的路径。它返回https://www.example.com%2Chttp//www.example.com
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<directoryBrowse enabled="false" />
<defaultDocument>
<files>
<clear />
<add value="index.htm" />
<add value="index.html" />
<add value="default.asp" />
<add value="default.aspx" />
<add value="index.php" />
<add value="index.asp" />
<add value="home.aspx" />
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="Redirect to https" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
</rule>
<rule name="Redirect to WWW" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^example.com$" />
</conditions>
<action type="Redirect" url="https://www.example.com/{R:0}" redirectType="Permanent" />
</rule>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{URL}" pattern="^system.*" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="/index.php?/{R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{URL}" pattern="^application.*" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="/index.php?/{R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 3" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?/{R:1}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>