Skip to content

Instantly share code, notes, and snippets.

@ashour
Created April 24, 2020 14:11
Show Gist options
  • Save ashour/5ecc1129849670e4c3860bdb9aadfaf5 to your computer and use it in GitHub Desktop.
Save ashour/5ecc1129849670e4c3860bdb9aadfaf5 to your computer and use it in GitHub Desktop.
using System.Web.Mvc;
using System.Web.Routing;
namespace Heaventure
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Root",
url: "",
defaults: new
{
controller = "Base",
action = "RedirectToLocalized"
}
);
routes.MapRoute(
name: "Default",
url: "{culture}/{controller}/{action}/{id}",
defaults: new
{
culture = "en",
controller = "Home",
action = "Index",
id = UrlParameter.Optional
},
constraints: new { culture = "en|ar" }
);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment