2014-01-20 3 views
0

모듈 Intelligencia.UrlRewriter (urlrewriter.net)을 사용하는 ASP.Net 웹 사이트가 있습니다. 검색 엔진이 두 개의 다른 웹 사이트로 두 URL을 처리하지 못하도록 www가 아닌 ​​www를 리디렉션하는 데 문제가 있습니다.Intelligencia.UrlRewriter를 사용하여 No-WWW를 WWW로 리디렉션

<redirect url="http://thetotalsite\.it(.+)" to="http://www.thetotalsite.it$1" /> 

그러나이 작동하지 않는, 또는 더 나은, 작동 "때때로"

나는 다음 시도했다. 에게 http://thetotalsite.it 그것은 내가 예를 들어 호스트 이름을 다음과 무언가를 가지고있는 경우, 대신

을 www.thetotalsite.it 리디렉션 가 : http://thetotalsite.it/a/article-nice-name

그것은 리디렉션하지 않습니다 예를 들어 는 경우 나는 접촉을 시도 .

어째서?

(노스 다코타 : 나는 기사의 URL 재 작성 처리하기 위해 다음과 같은 규칙을 사용

<rewrite url="https://stackoverflow.com/a/(.+)$" to="/articoli/showarticle.aspx?c=$1"/> 

) 사전에

감사합니다, 분명히

답변

0

을, 나는 내가가 발견 다음 사용하여 해결했다 또 다른 stackoverflow 질문 :

<!-- Ensure that all are on the same top domain and sub domain. --> 
<unless header="HTTP_HOST" match="www.thetotalsite.it"> 
    <redirect 
     url="^(.*)$" 
     to="http://www.thetotalsite.it$1" 
     processing="stop" /> 
</unless> 

ou UrlRewriter.Net의 오래된 버전, 그것은 작동하지 않습니다. 최신 소스 (2.0.0.9)를 다운로드하고 컴파일하십시오.

관련 문제