내 질문은 :방법으로 HttpContext로 리디렉션
가- 그래서 사용자 정의 클래스/HttpHandler를을 생성하고이 코드를 던져해야합니까? 또는 global.asax와 같은 다른 위치에 배치 할 수 있습니까?
- 리디렉션 할 때를 알기 위해 들어오는 호스트 (www.mydomain.com을 확인)를 어떻게 확인합니까?
코드 :
if ("comes from certain domain")
{
context.Response.Status = "301 Moved Permanently";
context.Response.AddHeader("Location", "http://www.testdomain.com/Some.aspx");
}
을 HttpModule의를 생성하는 이벤트 핸들러에게
를 추가합니다. –