2012-07-06 4 views
3

저는 IIS6 svr2003에서 IIS7.5 server 2008r2로 마이그레이션하고 URL 재 작성을 설치했습니다. 그것들은 모두 위대한 작품. 해당 웹 사이트는 규모가 크며 .net 2 통합 파이프 라인에서 실행됩니다. 지금은 .net 4에서 다시 실행할 수 없습니다. 나는 이것에 아주 새로운 것이고 나의 깊이에서 조금 여기에서이다. 다시 쓰기 기능을 사용하고 싶습니다.하지만 하위 응용 프로그램도 필요합니다. 어떤 도움을 주시면 감사하겠습니다.iis7.5는 하위 가상 응용 프로그램에 대해 500.52를 다시 작성합니다.

그러나 외부 공급 업체의 하위 가상 응용 프로그램은 webconfig의 다시 쓰기 섹션에 문제가 있습니다. 나는 그것을 논평하고 서브 가상 작품은 훌륭하다. 나는 웹에 보니 몇 가지를 시도했다 : 재 작성 모듈을 감싸

<location path="." inheritInChildApplications="false"> 

또는

<location path="." allowOverride="true" /> 

저를 부여하십시오 : system.web 요소가 잘못 자식 요소의 위치를 ​​가지고있다.

나는 서브 가상 응용 프로그램의 webconfig에서 바로 아래에서 시도했지만 주석을 다시 작성하여도 오류가 발생합니다. 제거를 시도 할 수는 있지만 누군가이 문제에 대해 어떤 통찰력을 줄 수 있는지 궁금해했습니다. 당신이 하위 응용 프로그램에서 clear 또는 remove을 사용, 짐작으로,

<rewrite> 
    <rules> 
    <rule name="RedirectUserFriendlyURL1" stopProcessing="true"> 
     <match url="^sethsBrochure.pdf$" /> 
     <conditions> 
     <add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" /> 
     </conditions> 
     <action type="Redirect" url="path/path/doc.pdf" appendQueryString="false" /> 
    </rule> 
    <rule name="RewriteUserFriendlyURL1" stopProcessing="true"> 
     <match url="^sethsBrochure$" /> 
     <conditions> 
     <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
     <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
     </conditions> 
     <action type="Rewrite" url="path/path/doc.pdf" /> 
    </rule> 
    </rules> 
    <outboundRules> 
    <rule name="OutboundRewriteUserFriendlyURL1" preCondition="ResponseIsHtml1"> 
     <match filterByTags="A, Form, Img" pattern="^(.*)path/path/doc\.pdf$" /> 
     <action type="Rewrite" value="{R:1}/ path/path/doc" /> 
    </rule> 
    <preConditions> 
     <preCondition name="ResponseIsHtml1"> 
     <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /> 
     </preCondition> 
    </preConditions> 
    </outboundRules> 
</rewrite> 

답변

0

가장 간단한 방법은 다음과 같습니다

여기에 기본적인 재 작성합니다. 예를 들어 당신이 온라인으로 발견

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
     <rewrite> 
      <rules> 
       <clear /> 
       <!-- Insert rules for this application (if any) **below** the "clear" --> 
      </rules> 
     </rewrite> 
    </system.webServer> 
</configuration> 

그러나, 당신은 또한 location 블록을 사용하여이 작업을 수행 할 수 있습니다. 시도한 문제는 위치 블록이 외부 인system.webServer 블록 외부에 있어야한다는 것입니다.

당신은 시도 것을 쓰기 :

<configuration> 
    <location path="." inheritInChildApplications="false"> 
     <system.webServer> 
      <rewrite> 
      ... 
      </rewrite> 
     <system.webServer> 
    </location> 
<configuration> 
:

<configuration> 
    <system.webServer> 
     <location path="." inheritInChildApplications="false"> 
      <rewrite> 
      ... 
      </rewrite> 
     </location> 
    <system.webServer> 
<configuration> 

는 대신에, 당신은이 작업을 수행 할 필요가