title: Multilingual Asp.Net Core 3.1 MVC application does not showing language code in url
body: <p>I'm working on an ASP.NET CORE application with multi lingual content. The culture is getting change successfully and it can be viewed in application cookies as well.</p>
  <p><a href="https://i.stack.imgur.com/SJf3X.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SJf3X.jpg" alt="enter image description here" /></a></p>
  <p>But the URL not changing by language switch.
  What I have tried in startup is as follow:</p>
  <p><strong>Startup ConfigureServices:</strong></p>
  <pre><code>services.AddLocalization(options =&gt; options.ResourcesPath = &quot;Resources&quot;);
  
  services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_3_0)
      .AddViewLocalization(LanguageViewLocationExpanderFormat.Suffix,
          options =&gt; { options.ResourcesPath = &quot;Resources&quot;; })
      .AddDataAnnotationsLocalization(options =&gt;
      {
          options.DataAnnotationLocalizerProvider = (type, factory) =&gt;
              factory.Create(typeof(ShareResource));
      });
  </code></pre>
  <p><strong>Startup Configure:</strong></p>
  <pre><code>var supportedCultures = new List&lt;CultureInfo&gt;()
  {
      new CultureInfo(&quot;en&quot;),
      new CultureInfo(&quot;de&quot;),
      new CultureInfo(&quot;fr&quot;),
      new CultureInfo(&quot;pt&quot;),
      new CultureInfo(&quot;tr&quot;)
  };
  
  var options = new RequestLocalizationOptions()
  {
      DefaultRequestCulture = new RequestCulture(&quot;en&quot;),
      SupportedCultures = supportedCultures,
      SupportedUICultures = supportedCultures,
      RequestCultureProviders = new List&lt;IRequestCultureProvider&gt;()
      {
          new QueryStringRequestCultureProvider(),
          new CookieRequestCultureProvider()
      }
  };
  app.UseRequestLocalization(options);
  
  app.UseEndpoints(endpoints =&gt;
  {
      endpoints.MapControllerRoute(
          name: &quot;defaultWithLang&quot;,
          pattern: &quot;{lang}/{controller=Home}/{action=Index}/{id?}&quot;);
      endpoints.MapControllerRoute(
          name: &quot;default&quot;,
          pattern: &quot;{controller=Home}/{action=Index}/{id?}&quot;);
  });
  </code></pre>
  <p>And in <strong>HomeController</strong>:</p>
  <pre><code>public IActionResult ChangeLang(string lang)
  {
      Response.Cookies.Append(CookieRequestCultureProvider.DefaultCookieName,
          CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(lang)),
          new CookieOptions(){
              Expires = DateTimeOffset.UtcNow.AddYears(1)
          });
  
      return Redirect(Request.Headers[&quot;Referer&quot;].ToString());
  }
  </code></pre>
  <p>The URL I expected to show is like &quot;http://domain/en/controller/action&quot; but it is not changing by switching the language and is always like &quot;http://domain/controller/action&quot; without language code.</p>
  <p>Is there anything else I have to add to my code in startup or somewhere else?
  Appreciated for any help.</p>