2014-09-25 2 views
0

MVC 응용 프로그램에서 HTTP에서 HTTPS로 리디렉션을 사용하고 있습니다. HTTP 대 HTTPS 리디렉션 예외

내가의 Web.config에서 사용하고 코드입니다 :

<rewrite> 
<rules> 
    <rule name="HTTP to HTTPS redirect" stopProcessing="true"> 
    <match url="(.*)" /> 
    <conditions> 
    <add input="{HTTPS}" pattern="off" ignoreCase="true" /> 
    </conditions> 
    <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}"/> 
    </rule> 
</rules> 
</rewrite> 

가 HTTPS에서 작동하지 않습니다 내 응용 프로그램의 페이지가있다, 그래서 나는이 규칙에 예외를 추가해야 .

누구든지 저를 도울 수 있거나 튜토리얼/예제를 보여줄 수 있는지 궁금합니다.

답변

0

URL에 대한 규칙을 무효화하는 조건을 추가하기 만하면됩니다. 새 규칙은 다음과 같습니다.

 <rule name="HTTP to HTTPS redirect" stopProcessing="true"> 
     <match url="(.*)" /> 
     <conditions> 
      <add input="{HTTPS}" pattern="off" ignoreCase="true" /> 
      <add input="{R:1}" pattern="myfolder\/myfile\.aspx" negate="true"/> 
     </conditions> 
     <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}"/> 
     </rule> 
+0

감사합니다. 그것은 내 문제를 해결했다. – user3853986

관련 문제