2012-01-12 3 views
2

SSL 인증서가 있고 모든 트래픽을 https로 보내도록 web.config에 다시 쓰기 규칙을 설정했습니다. 이것은 잘 작동합니다 (누군가가 유용하다고 생각하면 아래 코드를 작성합니다). 그러나 이제는 내 전화 클라이언트에 노출되는 서비스가 있고 HTTPS를 사용하지 않기를 바랍니다.ASP.NET web.config의 SSL 규칙 예외

예외를 만들 수 있습니까? 그래서 www.mydomain.com/PhoneService/Seek.svc에 대한 요청은 ..... https://www.mydomain.com에 다시 지시되지

<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> 
당신은 경로가 종료되지 않도록 규칙에 다른 조건을 사용할 수 있습니다

답변

3

seek.svc에서 :

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

라인 :

<add input="{URL}" pattern="seek\.svc$" ignoreCase="true" negate="true" /> 

URL 변수 수표 seek.svc로 끝난다. 이 일치하지 않으면 적용 할 규칙 만 있기 때문에 조건을 무효화합니다.이 일치하지 않습니다.

+0

참고 : {PATH_INFO}에서 {URL}까지 [더 정확한 내용] (http://msdn.microsoft.com/en-us/library/ms524602%28v=VS.90%29)으로 편집했습니다. aspx). – vcsjones

+0

눈부신, 그냥 내가 한 것. – Paul