title: Localization with MVC4 Routes in ASP.NET
body: <p>I'm trying to put differents languages in my website and I don't really understand the way to set correctly my routes to get it to work. Because with what I have currently i get a Redirection Loop.</p>
  
  <p>So here's the code :</p>
  
  <pre><code>routes.MapRoute(
        null,
        url: "{culture}/{pageName}",
        defaults: new
        {
          culture = UrlParameter.Optional,
          controller = "Redirect",
          action = "Index",
          pageName = "debug"
        });
          routes.MapRoute(
    null,
    "{pageName}/",
    new { controller = "Landing", action = "Index" }
    );
    routes.MapRoute(
    null,
    "{culture}/{pageName}/",
    new { controller = "Landing", action = "Index" },
    new { culture = "^[a-z]{2}" }
    );
    routes.MapRoute(
    null,
    "{culture}/blog/{pageName}",
    new { controller = "Blog", action = "Index" },
    new { culture = "^[a-z]{2}" }
    );
    routes.MapRoute(
    null,
    "blog/{pageName}",
    new { controller = "Blog", action = "Index" }
    );
  </code></pre>
  
  <p><strong>The question is : How to correctly set my routes to see the site that way :</strong> </p>
  
  <p>If hitting <code>/pageName</code> > Go to <code>/pageName</code> (the defaultCulture is set after and set to english)
  else If <code>/en/pageName</code> > Redirect to <code>/pageName</code>
  else If <code>/AnyCulture/pageName</code> > go to <code>/AnyCulture/pageName</code>
  else <code>/incorrectUrl</code> > Go to home</p>
  
  <p>Thanks for reading / answering :)</p>