使用以下代码
context.Response.StatusCode = 301; context.Response.Redirect(newUrl,true); context.Response.End();
我可以在fiddler看到它使用302而不是301.我应该在重定向调用后设置状态?
解决方法
如果你使用ASP.Net 4.0,你可以使用
Response.RedirectPermanent,它将使用301而不是302。