-
-
Save SpiritLing/c0f12694158378594991a3084c433df3 to your computer and use it in GitHub Desktop.
2020-01-14-iis-url-rewrite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!--- Origin Release:https://blog.spiritling.cn/posts/82f57ccc/ --> | |
<!--- Origin Develop:https://dev.blog.spiritling.pub/posts/82f57ccc/ --> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<clear /> | |
<!-- htpt => https --> | |
<rule name="demo-https" enabled="true" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions logicalGrouping="MatchAll" trackAllCaptures="false"> | |
<add input="{HTTPS}" pattern="^OFF$" /> | |
<add input="{HTTP_HOST}" pattern="^demo\.example\.com$" /> | |
</conditions> | |
<action type="Redirect" url="https://demo.example.com/{R:1}" /> | |
</rule> | |
<!-- https domain/4436 => https domain:4436 --> | |
<rule name="demo" enabled="true" stopProcessing="true"> | |
<match url="^4436/(.*)" /> | |
<conditions logicalGrouping="MatchAll" trackAllCaptures="false"> | |
<add input="{HTTPS}" pattern="^ON$" /> | |
<add input="{HTTP_HOST}" pattern="^demo\.example\.com$" /> | |
</conditions> | |
<action type="Rewrite" url="https://demo.example.com:4436/{R:1}" /> | |
</rule> | |
<!-- domain => https://localhost --> | |
<rule name="index" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions> | |
<add input="{HTTP_HOST}" pattern="^test\.example\.com$" /> | |
</conditions> | |
<action type="Rewrite" url="https://localhost" /> | |
</rule> | |
</rules> | |
</rewrite> | |
<caching enabled="false" enableKernelCache="false" /> | |
</system.webServer> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment