I've seen a few similar questions to mine but not exactly what I'm after.
this question shows me how to do the r开发者_如何学Pythonedirect but where/how do I put the extra information in the redirect to tell the search engines that it is a 301?
ASP.Net MVC - Trapping certain URL's to do 301 Redirect
You could try something like this:
public ActionResult Home() {
Response.Status = "301 Moved Permanently";
Response.RedirectLocation = "/";
Response.End();
return Redirect("~/");
}
This works for one off. If you have multiples, then you'll want to come up with some sort of handler.
One such handler I've used is Legacy Routing. It worked out quite well for me.
精彩评论