Reputation: 735
I have a website that we migrated from ASP.NET to MVC Framework.
The url With ASP.NET that used to be Ex: http://Website1/MasterData The URL now with MVC Fraemwork became http://Website1/Home/MasterData.
Now as the users of the site have Bookmarked the old URL, Now we need to maintain the same url. I would appreciate if anyone can provide steps how we can this?
Appreciate your responses.
Upvotes: 1
Views: 1476
Reputation: 180908
Provide a 301 redirect from the old url to the new url.
Or, provide static routes that trap the old urls and route them to the proper controller methods.
Upvotes: 2
Reputation: 3258
You could add a route in Global.asax so that users get the right screen from the old URL:
routes.MapRoute( _
"OldMasterDataRoute", _
"/Masterdata", _
New With {.controller = "Home", .action = "MasterData", .id = ""} _
)
Upvotes: 1
Reputation: 11433
You can modify the RegisterRoutes method in the Global.asax.cs file to specify your desired paths.
Upvotes: 1