2012-11-21 2 views
0

IIS 7.5에서 웹 응용 프로그램의 별칭을 만들 필요가 있습니다.IIS 7.5의 웹 응용 프로그램 별칭

IIS 7.5에서이 동작을 수행하는 가장 좋은 방법은 무엇입니까? 가능한 경우 IIS 관리자에서 구성 할 수있는 위치와 web.config을 설명하십시오.

답변

0

당신은 당신은 URL 재 작성 모듈이 설치되어 있어야합니다 Rewrite 모듈,

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
     <rewrite> 
      <rules> 
       <rule name="MyHappyApp2_To_HappyAppPart3" stopProcessing="true"> 
        <match url="MyHappyApp2" ignoreCase="true" /> 
        <conditions logicalGrouping="MatchAll"> 
         <add input="{URL}" pattern="^/$" ignoreCase="true" /> 
        </conditions> 
        <action type="Rewrite" url="/HappyAppPart3" /> 
       </rule> 
      </rules> 
     </rewrite> 
     <security> 
      <requestFiltering allowDoubleEscaping="true" /> 
     </security> 
    </system.webServer> 
</configuration> 
0

를 사용해야합니다. IIS 관리자를 통해 규칙을 구성하거나 수동으로 web.config에 규칙을 추가 할 수 있습니다.

하나의 규칙으로 모두 처리 할 수도 있지만 리디렉션하려는 별칭에 대해 하나씩 두 개의 별도 규칙을 만드는 것이 더 쉽습니다.

이 작동합니다 :

<rewrite> 
    <rules> 
     <clear /> 
     <rule name="Redirect MyHappyApp2 to MyHappyApp" stopProcessing="true"> 
      <match url="^MyHappyApp2(/.*)?$" /> 
      <action type="Redirect" url="http://server.com/MyHappyApp{R:1}" appendQueryString="true" redirectType="Permanent" /> 
     </rule> 
     <rule name="Redirect HappyAppPart3 to MyHappyApp" stopProcessing="true"> 
      <match url="^HappyAppPart3(/.*)?$" /> 
      <action type="Redirect" url="http://server.com/MyHappyApp{R:1}" appendQueryString="true" redirectType="Permanent" /> 
     </rule> 
    </rules> 
</rewrite> 

위의 규칙은 또한 http://server.com/HappyAppPart3/somepage?id=1 (단지 예)에가는 사람들을 지원합니다. 그들은 http://server.com/MyHappyApp/somepage?id=1로 리디렉션됩니다.

관련 문제