아니다 그러나 이것은 일반적으로 어떤 무엇을 어떻게 (도메인 이름 규칙 정식되지 않습니다 : 작업 이 경우 원하는)가 설정됩니다. 일반적으로 과 일치하는 모든 URL을 서버에 입력 한 다음 CGI 환경 변수 값 (이 경우 HTTP_HOST
)을 필터링합니다. 귀하의 재 작성 규칙은 다음과 같이 보일 것입니다 :
<rule name="CanonicalHostNameRule1" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^mywebsite\.com$" negate="true" />
</conditions>
<action type="Redirect" url="https://mywebsite.com/{R:1}" appendQueryString="false" redirectType="Permanent" />
</rule>
이것이 할 것입니다 것은 앞으로 https://mywebsite.com
-http://mywebsite.com
또는 https://mywebsite.com
을하지 않은 URL의 모든 요청이다. 실제 URL은 일치 항목에 캡처되고 {R:1}
매개 변수에 넣습니다. 이렇게하면 http://www.mywebsite.net/home.php
이라고 말하면 https://mywebsite.com/home.php
으로 리디렉션됩니다. 당신이 HTTPS를 시행 할 경우
또한, 다음을 수행 할 수 있습니다
<rule name="CanonicalHostNameRule1" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="^on$" negate="true" />
<add input="{HTTP_HOST}" pattern="^mywebsite\.com$" negate="true" />
</conditions>
<action type="Redirect" url="https://mywebsite.com/{R:1}" appendQueryString="false" redirectType="Permanent" />
</rule>
첫 번째 조건은 cgi.HTTPS
이 ... "의"있는지 확인하고 그렇지 않은 경우,로 리디렉션됩니다 HTTPS URL.
참고 : 만 mywebsite.net
URL을 재 지정하려면는 다음 조건이 다음과 같습니다이 도움이
<add input="{HTTP_HOST}" pattern="mywebsite\.net$" />
희망.