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.

1 Answer 1

2

Create a redirection handler. Link

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.