ASP.NET Response.Redirect uses 302 instead of 301

前端 未结 4 1415
不知归路
不知归路 2020-12-28 14:00

using the following code

context.Response.StatusCode = 301;

context.Response.Redirect(newUrl, true);
context.Response.End();

I can see in

4条回答
  •  孤城傲影
    2020-12-28 14:33

    301 is cache-able. if you are using ASP.NET 4.0 , you can use RedirectPermanent.

    Also, set your statuscode after Redirect

    also, look into these answers. Response.Redirect HTTP status code

提交回复
热议问题