2013-05-29 3 views
1
내가 IIS7에서 http://www.mysite.com의 web.config 파일에있는 규칙을 만들려고 이것에 대한 http://www.mysite.com/badreferer.aspx?bad=true

URL 재 작성은 - 오류이 웹 페이지에 리디렉션 순환

http://www.example.com에서 오는 모든합니다 traffice 리디렉션 싶습니다

있습니다.

<rule name="bad referer" stopProcessing="true"> 
     <match url="(.*)" /> 
     <conditions> 
        <add input="{HTTP_REFERER}" pattern="(.*)example(.*)" /> 
     </conditions> 
     <action type="Redirect" url="/badreferer.aspx?bad=true" appendQueryString="false" />   
    </rule> 

그러나 리디렉션 루프 문제가 있습니다.

도와주세요.

감사합니다.

답변

1

이 시도 :

<rules> 
    <rule name="bad referer" stopProcessing="true"> 
    <match url="^(.*)" /> 
    <conditions> 
     <add input="{HTTP_REFERER}" pattern="http://www.example.com(.*)" negate="true" /> 
    </conditions> 
    <action type="Redirect" url="http://www.website.com/badreferer.aspx?bad=true" /> 
    </rule> 
</rules> 

갱신 :

<rule name="bad referer" stopProcessing="true"> 
    <match url=".*" /> 
    <conditions logicalGrouping="MatchAll" trackAllCaptures="true"> 
     <add input="{REQUEST_URI}" pattern="/badreferer\.aspx?bad=true" negate="true" /> 
     <add input="{HTTP_REFERER}" pattern="^www.\example\.com.*" /> 
    </conditions> 
    <action type="Redirect" url="/badreferer.aspx?bad=true" appendQueryString="false" /> 
</rule> 
+0

사이트 B는 여기에 무엇입니까? 더, 이건 내 문제를 해결할 수 없습니다. – Maddy

+0

죄송합니다. 내 예제 –

+0

을 편집하지 않으면 내 사이트의 모든 링크가 해당 URL로 리디렉션됩니다 – Maddy