Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8391907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:22:50+00:00 2026-06-09T19:22:50+00:00

Typically I want the default route used when generating URLs (backwards mapping), even if

  • 0

Typically I want the default route used when generating URLs (“backwards” mapping), even if I’ve added alternate or legacy routes to reach an action (“forwards”):

routes.MapRoute("Legacy", "legacy/home/index",     // want forward-only mapping!
    new { controller = "Home", action = "Index" };
routes.MapRoute("Default", "{controller}/{action}/{id}",
    new { controller = "Home", action = "Index", id = UrlParameter.Optional }

In this case, I’d still want the default route used when I call:

@ActionLink("Index", "Home")                       // generates legacy URLs ;(

In the thread: Routing legacy requests with and without querystring (issue #1), the solution is to add two MapRoute statements for each legacy route, or specify the route name in each ActionLink call.

Is there a way to define a route used only for URL -> Action mapping, not the inverse?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:22:52+00:00Added an answer on June 9, 2026 at 7:22 pm

    I can’t find a way to have the route statements apply only one way, so I installed the IIS URL Rewrite module. This works to rewrite the URL transparently, or 301-redirect it in the case of legacy URLs.

    It’s a more maintainable solution than editing the global.asax anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand that for a CPU-bound task that you typically want 1 thread per
Typically, my event handling occurs in the UIViewController, so i used the following line
I typically want to ignore white space changes when diff'ing with mercurial. If I
I have added a default menu control to my user control. I need to
I want to use encrypted strings in MVC2 urls. A typical url in my
I want to override the default activity transition in Android with something a bit
This should be typically easy, I want to perform tracking of mouse movements. I'm
I'm quite new to Java and from Python and PHP, I'm used to default
I want to centralize as possible the character encoding used by my JSF pages.
I want to create a PDF that will bring up a typical OK/Cancel alert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.