Does anybody know how to redirect to another server/solution using ASP.NET MVC? Something like this:
public void Redir(String param)
{
// Redirect to another application, ie:
// Redirect("www.google.com");
// or
// Response.StatusCode= 301;
// Response.AddHeader("Location","www.google.com");
// Response.End();
}
I´ve tried both ways above, but it doesn´t work.
The
RedirectResultwill give you a 302, however if you need a 301 use this result type:Then use it like mentioned above:
Source (as it’s not my work): http://forums.asp.net/p/1337938/2700733.aspx