2011-03-24 9 views
1

urlrewriting.net을 사용하고 있으며 모든 클래식 ASP 요청을 default.aspx에 매핑하는 규칙을 추가하고 싶습니다.urlrewriting.net 모든 클래식 ASP 요청을 default.aspx에 매핑하십시오.

아래의 불행히도 내 시도는 리디렉션 루프를 초래하므로 잘못 처리해야합니다.

<add name="LegacyRedirect" 
    virtualUrl="^~/(.*).asp" 
    redirectMode="Permanent" 
    redirect="Application" 
    destinationUrl="~/default.aspx"/> 

많은 감사, 벤

답변

2

내가 내 정규 표현식의 끝에 $ 누락 된 것 같습니다.

다음은 (사이트 루트에 대한 모든 ASP 요청을 리디렉션) 나를 위해 일한 것입니다 :

(예를 들어 default.aspx에) 표준 페이지를 요청할 때 안녕하세요, 불행히도 이것은 또한 리디렉션 루프 결과
<add name="LegacyRedirect" 
    virtualUrl="^~/([^?]*)\.asp$" 
    redirectMode="Permanent" 
    redirect="Application" 
    destinationUrl="~/"/> 
2
<add name="LegacyRedirect" 
    virtualUrl="^~/(.*).asp" 
    redirectMode="Permanent" 
    redirect="Application" 
    destinationUrl="~/default.aspx" 
    processing="stop" 
/> 

은보십시오. 그리고이 규칙을 다른 모든 것보다 먼저 넣으십시오. 처리 = 중지는 규칙이 일치하면 다른 규칙을 적용하지 않음을 의미합니다. 또한

,

destinationUrl="~/default.aspx" 

는 아마 될 수 있습니다

destinationUrl="~/" 
+0

. .aspx 페이지에 대한 요청 또한 위의 규칙과 일치하는 것으로 보입니다. –

+0

@Ben, 디렉토리의 기본 페이지는 무엇입니까? default.asp 또는 default.aspx입니까? 기본 페이지가 ASP 인 경우 리디렉션을 중지하지 않습니다. –