2017-12-21 26 views
1

https를 강제 실행하려면 다음을 web.config에 넣습니다.HTTPS web.config의 www 리디렉션

<rule name="Redirect to https" stopProcessing="true"> 
<match url="(.*)" /> 
<conditions> 
<add input="{HTTPS}" pattern="off" ignoreCase="true" /> 
</conditions> 
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" /> 
</rule> 

하지만 저는 www를 강제합니다. 또한 이들 모두가 https://www 버전으로 이동합니다. 달성해야하는 항목 :

http://www.domain.tld/whatever 
http://(no-www)domain.tld/whatever 
https://(no-www)domain.tld/whatever 

감사합니다.

+0

@cfnerd 안녕하세요, 먼저 사용했지만 호가 포함되어 있지 않습니다. www를 강요하는 w. 부품. – doubleplusgood

답변

0

다음을 수행합니다이 규칙 님의

  • 리디렉션을 HTTPS
  • 강제 www가

<rule name="Redirect to https" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="off" />
<add input="{HTTP_HOST}" pattern="^www." negate="true" />
</conditions>
<action type="Redirect" url="https://www.example.com{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
</rule>

당신이 당신의 도메인 이름으로 www.example.com을 변경하는 것입니다 필요로하는 모든