ASP.NET MVC 4 – 301 Redirects in RouteConfig.cs

You have to use RedirectPermanent, here’s an example:

public class RedirectController : Controller
{

    public ActionResult News()
    {

        // your code

        return RedirectPermanent("/News");
    }
}

in the global asax:

    routes.MapRoute(
        name: "News old route",
        url: "web/news/Default.aspx",
        defaults: new { controller = "Redirect", action = "News" }
    );

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)