2017-10-13 1 views
0

이 사이트는 "localhost"입니다. 나는 모든 페이지가 "localhost/order.aspx? r = 15"를 제외하고 https를 가져야한다. 여기서 문제는 "localhost/order.aspx? r = 15"를 포함하여 모든 페이지를 HTTPS로 리디렉션하는 것입니다. 또한 같은 패턴을 시도했다 "^/로컬 호스트/order.aspx $" HTTPS가 작동하지 않음

답변

0

<rule name="Force HTTPS" stopProcessing="true"> 
 
    <match url="(.*)" /> 
 
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> 
 
    <add input="{HTTPS}" pattern="off" ignoreCase="true" /> 
 
    <add input="{REQUEST_URI}" pattern="(order.*)" ignoreCase="true" negate="true" /> 
 
    </conditions> 
 
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" /> 
 
    </rule>
그래서 나는 그것을 해결했습니다. 시간 브라우저가 HTTPS 경로를 기억하기 때문에 브라우저 캐시를 지 웁니다. HTTP 만 제공하더라도 HTTPS를 검색하려고합니다. IE를 사용하여이를 테스트하는 것이 좋습니다.

이와 같은 규칙을 업데이트하십시오.

<rule name="NoSSL - folder" enabled="true" stopProcessing="true"> 
 
    <match url="order.*" /> 
 
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> 
 
    </conditions> 
 
    <action type="None" /> 
 
</rule> 
 
<rule name="Redirect to HTTPS" enabled="true" stopProcessing="true"> 
 
    <match url="(.*)" /> 
 
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> 
 
     <add input="{HTTPS}" pattern="off" /> 
 
    </conditions> 
 
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Found" /> 
 
</rule>

관련 문제