Iis 重写允许从 URL 参数进行不需要的重定向

编程

[ad_1]

我们有一个托管在 Azure 和 IIS 上的 ASP.NET Core 7 MVC 应用程序。 出于某些目的,例如添加尾部斜杠,我们使用 URL 重写。 但此规则似乎会导致 URL 参数出现不需要的重定向问题,因此,例如,https://example.com/http:/google.com 将重定向到 Google 网站。

发生的情况是这样的:当请求进入 RewriteModule 时,它​​看起来像这样:

http://rockstar-dev-web-01:80/http:/google.com

(有点混乱,但你明白了),但随后它似乎自己分成两部分,第二部分正在处理。 一旦命中添加尾部斜杠重写,就会进行 301 重定向。 以下是说明此行为的日志,您可以看到仅处理 URL 的后半部分:

GENERAL_REQUEST_START SiteId="1922794053237", AppPoolId="rockstar-dev-web-01", ConnId="805308232052", RawConnId="8053080123152", RequestURL="http://rockstar-dev-web-01:80/https:/wp.pl", RequestVerb="GET" 20:16:22.600 PRE_BEGIN_REQUEST_START ModuleName="FailedRequestsTracingModule" 20:16:22.600 PRE_BEGIN_REQUEST_END ModuleName="FailedRequestsTracingModule", NotificationStatus="NOTIFICATION_CONTINUE" 20:16:22.600 PRE_BEGIN_REQUEST_START ModuleName="RequestMonitorModule" 20:16:22.600 PRE_BEGIN_REQUEST_END ModuleName="RequestMonitorModule", NotificationStatus="NOTIFICATION_CONTINUE" 20:16:22.600 PRE_BEGIN_REQUEST_START ModuleName="IsapiFilterModule" 20:16:22.600 FILTER_PREPROC_HEADERS_START 20:16:22.600 FILTER_START FilterName="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_filter.dll" 20:16:22.600 GENERAL_SET_REQUEST_HEADER HeaderName="AspFilterSessionId", HeaderValue="", Replace="true" 20:16:22.600 FILTER_SET_REQ_HEADER HeaderName="AspFilterSessionId:", HeaderValue="" 20:16:22.600 FILTER_END NotificationStatus="SF_STATUS_REQ_NEXT_NOTIFICATION" 20:16:22.600 FILTER_PREPROC_HEADERS_END 20:16:22.600 PRE_BEGIN_REQUEST_END ModuleName="IsapiFilterModule", NotificationStatus="NOTIFICATION_CONTINUE" 20:16:22.600 PRE_BEGIN_REQUEST_START ModuleName="RewriteModule" 20:16:22.600 PRE_BEGIN_REQUEST_END ModuleName="RewriteModule", NotificationStatus="NOTIFICATION_CONTINUE" 20:16:22.600 PRE_BEGIN_REQUEST_START ModuleName="ARRHelper" 20:16:22.600 PRE_BEGIN_REQUEST_END ModuleName="ARRHelper", NotificationStatus="NOTIFICATION_CONTINUE" 20:16:22.600 PRE_BEGIN_REQUEST_START ModuleName="DynamicIpRestrictionModule" 20:16:22.600 PRE_BEGIN_REQUEST_END ModuleName="DynamicIpRestrictionModule", NotificationStatus="NOTIFICATION_CONTINUE" 20:16:22.600 PRE_BEGIN_REQUEST_START ModuleName="ProcessMonitoringModule" 20:16:22.600 PRE_BEGIN_REQUEST_END ModuleName="ProcessMonitoringModule", NotificationStatus="NOTIFICATION_CONTINUE" 20:16:22.600 PRE_BEGIN_REQUEST_START ModuleName="DWASModule" 20:16:22.600 GENERAL_SET_REQUEST_HEADER HeaderName="HOST", HeaderValue="develop.rockstar.com", Replace="true" 20:16:22.600 GENERAL_SET_REQUEST_HEADER HeaderName="x-ms-http-forward", HeaderValue="", Replace="true" 20:16:22.600 PRE_BEGIN_REQUEST_END ModuleName="DWASModule", NotificationStatus="NOTIFICATION_CONTINUE" 20:16:22.600 PRE_BEGIN_REQUEST_START ModuleName="AzureSlaModule" 20:16:22.600 PRE_BEGIN_REQUEST_END ModuleName="AzureSlaModule", NotificationStatus="NOTIFICATION_CONTINUE" 20:16:22.600 GENERAL_REQUEST_HEADERS Headers="Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,/;q=0.8 Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.5 Host: develop.rockstar.com Max-Forwards: 10 TE: trailers User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0 DNT: 1 sec-gpc: 1 sec-fetch-dest: document sec-fetch-mode: navigate sec-fetch-site: none sec-fetch-user: ?1 X-ARR-LOG-ID: c57dc640-fe88-4a55-823c-3620113afe17 DISGUISED-HOST: develop.rockstar.com X-SITE-DEPLOYMENT-ID: rockstar-dev-web-01 WAS-DEFAULT-HOSTNAME: rockstar-dev-web-01.azurewebsites.net X-Forwarded-Proto: https X-AppService-Proto: https X-Forwarded-TlsVersion: 1.3 X-Original-URL: /https://wp.pl X-WAWS-Unencoded-URL: /https://wp.pl 20:16:22.600 URL_CACHE_ACCESS_START RequestURL="/https:/wp.pl"

我尝试过的:

我已经删除了重写规则,并且不再允许重定向,但这不是一个长期选择。 我也尝试过重新调整重写的顺序,但没有成功 – 问题仍然存在。

如何解决这个问题?

编辑:我们重写的列表:

<rules>
<rule name="rockstar siteassets test" stopProcessing="true">
	<match url="^siteassets\/(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.co\.uk$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstarasia\.com$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.de$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.fr$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.ru$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.in$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop-fr\.rockstar\.com$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.no" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.se" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.dk" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.fi" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.at" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.cz" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstargroup\.com$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar SysSiteAssets test" stopProcessing="true">
	<match url="^SysSiteAssets\/(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.co\.uk$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstarasia\.com$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.de$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.fr$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.ru$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.in$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop-fr\.rockstar\.com$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.no" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.se" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.dk" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.fi" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.at" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.cz" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstargroup\.com$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar globalassets test" stopProcessing="true">
	<match url="^globalassets\/(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.co\.uk$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstarasia\.com$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.de$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.fr$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.ru$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.in$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop-fr\.rockstar\.com$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.no" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.se" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.dk" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.fi" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.at" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.cz" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstargroup\.com$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar contentassets test" stopProcessing="true">
	<match url="^contentassets\/(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.co\.uk$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstarasia\.com$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.de$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.fr$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.ru$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.in$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop-fr\.rockstar\.com$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.no" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.se" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.dk" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.fi" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.at" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.cz" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstargroup\.com$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar dam.papirfly test" stopProcessing="true">
	<match url="^dam\.papirfly\/(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.co\.uk$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstarasia\.com$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.de$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.fr$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.ru$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.in$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop-fr\.rockstar\.com$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.no" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.se" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.dk" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.fi" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.at" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.cz" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstargroup\.com$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar dist/assets test" stopProcessing="true">
	<match url="^dist\/assets\/(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.co\.uk$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstarasia\.com$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.de$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.fr$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.ru$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.in$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop-fr\.rockstar\.com$" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.no" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.se" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.dk" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.fi" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.at" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.cz" />
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstargroup\.com$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar UK develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.co\.uk$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/uk{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar Asia develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstarasia\.com$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/asia{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar DE develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.de$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/de{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar FR develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.fr$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/fr{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar IN develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.in$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/in{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar RU develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.ru$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/ru{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar PL develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.pl$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/pl{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar CZ develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.cz$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/cz{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar NL develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.nl$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/nl{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar DK develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.dk$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/dk{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar FR-CA develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop-fr\.rockstar\.com$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/fr-ca{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar SE develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.se$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/se{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar NO develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.no$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/no{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar FI develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.fi$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/fi{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar AT develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstar\.at$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/at{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="rockstar Group develop redirect" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTP_HOST}" ignoreCase="true" matchType="Pattern" pattern="^develop\.rockstargroup\.com$" />
	</conditions>
	<action type="Redirect" url="https://develop.rockstar.com/group{PATH_INFO}" redirectType="Permanent"/>
</rule>
<rule name="Add trailing slash" stopProcessing="true">
	<match url="(.*[^/])$"  ignoreCase="true"/>
	<conditions>
		<add input="{URL}" pattern="^(.+?)/$" negate="true"/>
		<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
		<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
		<add input="{REQUEST_FILENAME}" pattern="(.*?)\.html$" negate="true" />
		<add input="{REQUEST_FILENAME}" pattern="(.*?)\.xml$" negate="true" />
		<add input="{REQUEST_FILENAME}" pattern="(.*?)\.aspx$" negate="true" />
		<add input="{URL}" pattern="^/(.*?)?(/?)(siteassets|globalassets|contentassets|SysSiteAssets|bundles|api|papirfly|dist|Static/HouseProductDemo|mini-profiler-resources|custom-routes|auth0|dam.papirfly)\/" negate="true"/>
		<add input="{URL}" pattern="^/(.*?)?(/?)(robots.txt|favicon.ico|Sitemap.xml|sitemap-index.xml)" negate="true"/>
		<add input="{URL}" pattern="^/(.*?)?(/?)(modules/Protected|EPiServer|EPiServer/CMS/admin|util|modulesbin|IndexingService/IndexingService.svc)" negate="true"/>
		<add input="{URL}" pattern="^/(.*?)?(/?)(productsOverviewAsync|languageSelectorAsync|rockstarNodeAsync|rockstarNodeAsync)" negate="true"/>
		<add input="{URL}" pattern="^/(rockstarProductAsync|rockstarRtiProductAsync)" negate="true"/>
		<add input="{URL}" pattern="^/(.*?)?(/?)(documentationListAsync|downloadAndOrderItemsAsync|videoListAsync|commerceDocumentLibraryAsync|parafonCommerceDocumentLibraryAsync)" negate="true"/>
		<add input="{URL}" pattern="^/(.*?)?(/?)(GatedContentPageAsync)" negate="true"/>
		<add input="{URL}" pattern="^/.*/sitemap.xml$" negate="true"/>
	</conditions>
	<action type="Redirect" redirectType="Permanent" url="{R:1}/" />
</rule>
<rule name="http to https" stopProcessing="true">
	<match url="^(.*)$" ignoreCase="true"/>
	<conditions logicalGrouping="MatchAny">
		<add input="{HTTPS}" ignoreCase="true" matchType="Pattern" pattern="off" />
	</conditions>
	<action type="Redirect" url="https://{HTTP_HOST}{PATH_INFO}" redirectType="Permanent"/>
</rule>
</rules>

解决方案1

假设是“添加尾部斜杠”规则导致了问题,则您的匹配缺少“行首”锚点:

XML
<match url="(.*[^/])$" ignoreCase="true"/>

应该:

XML
<match url="^(.*[^/])$" ignoreCase="true"/>

[ad_2]

コメント

标题和URL已复制