2011-11-03 2 views
2

고객이 사이트의 하위 폴더에 자신의 웹 사이트 콘텐츠를 가지고 있습니다. www.customersite.com/content. 이후 루트 폴더로 이동되었습니다. www.customersite.comIIS 301 하위 폴더에서 루트 폴더로 리디렉션

우리는 다음과 같습니다 사이트 설정하려면 IIS 301 리디렉션을 추가 한

:

<rewrite> 
    <rules> 
    <rule name="Redirect to Root" stopProcessing="true"> 
    <match url=".*" /> 
     <conditions> 
     <add input="{HTTP_HOST}" pattern="^customersite.com/content/$" /> 
     </conditions> 
     <action type="Redirect" url="http://www.customersite.com/{R:0}" 
     redirectType="Permanent" /> 
    </rule> 
    </rules> 
</rewrite> 

이 사이트는 www.customersite.com/content/처럼 보였다 링크를했다? p = 12 사용자가 이전 www.customersite.com/content/?p=12 주소를 입력하면 자동으로 www.customersite.com/?p=12로 리디렉션되도록 리디렉션을 변경할 수 있습니까? 그렇다면 어떻게?

감사합니다.

답변

3

입니다 보여,하지만이 작동합니다 :

<rewrite> 
    <rules> 
    <rule name="Redirect to Root" stopProcessing="true"> 
    <match url="^content/(.*)" /> 
     <conditions> 
     <add input="{HTTP_HOST}" pattern="^(www\.)?customersite.com$" /> 
     </conditions> 
     <action type="Redirect" url="http://{C:0}/{R:1}" redirectType="Permanent" /> 
    </rule> 
    </rules> 
</rewrite> 
0

www.customersite.com/content/?p=12 인 모든 파일은 실제로 IIS의 기본 페이지 중 하나이므로 www.customersite.com/content/index.aspx와 같은 페이지가됩니다. ? p = 12 기본 파일이 index.aspx라고 가정하면 기본값이 될 수 있습니다.

이 위치에 파일을 추가하고 쿼리 문자열을 가져오고 리디렉션을 수행하도록 코드를 설정하기 만하면 헤더를 변경할 수도 있습니다 코드의 상태는 뒤에 이것이 내가 지금 그것을 테스트 할 수 없습니다 해요 (301)

관련 문제