tags:

views:

114

answers:

1

I have a route:

    routes.MapRoute(
        "Company",
        "{id}/{name}.aspx",
        new { controller = "Company", action = "CompanyIndex" }
        );

I need redirect to the same URL, but without ".aspx" extension:

    routes.MapRoute(
        "Company",
        "{id}/{name}",
        new { controller = "Company", action = "CompanyIndex" }
        );

But the old URL (with aspx extension) can't return 404 error code. It just need redirect using 301 permanent redirect.