简体   繁体   中英

IIS rewrite rule with exact match https url results in error

I've converted a site from ASP.NEt webforms to MVC 5 and have successfully written rules to redirect all the old .aspx pages -- except for the only encrypted page.

I would greatly appreciate help in correcting this rule, which results in net::ERR_CORRECTION_RESET

<rule name="https link" stopProcessing="true" patternSyntax="ExactMatch">
<match url="https://www.mysite.org/ssl/securedonation.aspx" />

 <action type="Redirect" url="/donate/" redirectType="Permanent"/>
</rule> 

I suspect I need to add a condition, but have not been able to figure out its syntax or function.

Many thanks.

You only need to add a condition if you only want to match on https and not http for example. But in your case I would think this doesn't matter. You can just redirect the securedonation.aspx page to /donate/, there's no need to treat this any differently just because it uses https. Try this:

<rule name="https link" stopProcessing="true" patternSyntax="ExactMatch">
    <match url="ssl/securedonation.aspx" />

    <action type="Redirect" url="/donate/" redirectType="Permanent"/>
</rule> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM