2013-04-15 2 views
1

.net 웹 사이트에서 리디렉션해야하는 몇 개의 링크가 있습니다. 예를 들어, http://www.example.com/products/productname (현재는 더 이상 존재하지 않음)을 http://www.example.com/products/productname.aspx으로 리디렉션해야합니다.죽은 URL을 web.config의 새 URL로 리디렉션

web.config에서 301 리디렉션을 설정하려면 어떻게해야합니까?

감사합니다.

가 현재 나는 다음과 같습니다

<location path="draft_root_beer"> 
<system.webServer> 
<httpRedirect enabled="true" destination="~/products/draft_root_beer.aspx"  httpResponseStatus="Permanent" /> 
</system.webServer> 
</location> 

답변

0

그것은 단지 "에서 .aspx"을 추가하는 경우, 당신이 URL Rewriting를 사용하는 것이 좋습니다, 링크는 검색 엔진 최적화에 대한 더 좋을 것이다. 울부 짖는 소리와 같은 그렇지 않으면 통 더 뭔가 :

<location path="productname"> 
    <system.webServer> 
     <httpRedirect enabled="true" destination="http://www.example.com/products/productname.aspx" httpResponseStatus="Permanent" /> 
    </system.webServer> 
    </location> 
+0

I가 다음 <위치 경로 = "draft_root_beer"> <의 system.webServer> 여전히 404 오류가 발생합니다. 나는 명백한 것을 놓치고 있는가? – Zach

+0

와우는 추악했습니다. [ – Zach

+0

"~/products ..."대신 "ht tp : //www.example.com/products ..."로 시도해 보셨습니까? – criticalfix

관련 문제