Redirect old aspx to new MVC

I upgraded to be ASP.NET MVC and one of the problem is the old pages are indexed by search engines and being served on search results. So I have the old *.aspx page that I need to fix up and send along to the MVC page.

An example of the page in the search database;

And I need it to go to the new MVC controller and action like this;

So I did it this way, I put this in the Global.aspx.cs file;

Probably not the most elegant, but it does work.





3 thoughts on “Redirect old aspx to new MVC”

  1. Is there any reason why you didnt do:

    if (Request.Path.Contains(“/viewdvd.aspx”)) {
    Response.Redirect(“/Media/Detail/” + Request.QueryString[“upc”]);


Leave a Reply