URL Rewrite configuration download

 

We can also manually download URL Rewrite plugin, which is the official address: URL Rewrite download ,

After installation, webconfig add the following configuration.

<the rewrite>
<the rules>
<rule name = "HostNameRule1">
<URL match = "(*.)" />
<-! Match all conditions ->
<Conditions logicalGrouping = "MatchAny">
<-! When it is not when accessed using the https protocol ->
<the Add INPUT = "{} the hTTPS" pattern = "OFF ^ $" />
<-! Host and this access is not potekelec.com, e.g. www.potekelec.com-- >
<the Add INPUT = "{} HTTP_HOST" pattern =. ". ^ WWW \ ******** \ COM $" = o negate "to true" />
</ Conditions>
<-! Jump to https- ->
<Action type = "the Redirect" URL = "HTTPS: R & lt //www.********.com/ {:}. 1" redirectType = "Permanent" />
</ rule>
<rule name = "HTTPS redirect">
<URL match = "(. *)" />
<Conditions>
<-! When using the HTTPS protocol to access ->
<the Add INPUT = "{} HTTPS" pattern = "the ON ^ $" />
<-! When access https://potekelec.com time ->
<add input="{HTTP_HOST}" pattern="^www\.********\.com$" negate="true" />
</conditions>
<!--跳转到HTTPS-->
<action type="Redirect" url="https://www.********.com/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>

Guess you like

Origin www.cnblogs.com/tianlong/p/12175817.html