Question: Let me explain my issue.

I've a site with .aspx pages (webforms) publish on server, eg: *www.mysite.com*.

A few mounth ago, it launch a masive digital marketing campage where the most important it's the contact form, eg: *www.mysite.com/contact.aspx.*

Now (forget the razon), the project was migrated an mvc project. Then, the new contact form is accesed throug *www.mysite.com/contact*. It's to say, by route, not by page.

I need a way to redirect from *www.mysite.com/contact.aspx* (link sent on campaing) to *www.mysite.com/contact* in MVC project. It's to say: no server http or dns configuration.

I try create a page *contact.aspx*. on my mvc project and redirect to route */contact*, but doesn't work. I suposse because MVC working about route not about view (.aspx in this case).

Somebody can help me with any idea or instruction? Remenber, not it's possible work on server configuration, just coding on mvc project.

Project ASP.net MVC4 and framework 4.5

Answer: 
I think I know what you want to do...

Add the Contact.aspx to the root of your MVC application.

Then in the code behind, add a RedirectToRoute call the Page\_Load event in Contact.aspx.cs, like this:

*(Assuming your new Contact Razor view is called 'Index' and is in the 'Contact' controller)*

```
public partial class Contact : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.RedirectToRoute(new { controller = "Contact", action = "Index" });
    }
}

```

If your Contact.aspx isn't in the same project as your MVC Controllers, then you could try a normal Response.Redirect like this:

```
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Redirect("~/Contact/Index");
    }

```
You can change only in current MVC project RouteConfig file for 301 Redirect Permanently.

for this www.mysite.com/contact.aspx use below route config

```
 routes.MapRoute(
               name: "ContactOld",
               url: "Contact.aspx",
               defaults: new { controller = "Home", action = "Contact", id = UrlParameter.Optional }
           );

```

for this www.mysite.com/contact use below route config

```
    routes.MapRoute(
       name: "Contact",
       url: "Contact",
       defaults: new { controller = "Home", action = "Contact", id = UrlParameter.Optional }
   );

```