title: Changing Route Config impact on ajax url and embedding controller name in request (Mulitple Time)
body: <p>My all ajax calls unexpectedly appending controller name <strong>twice</strong> in ajax calls by changing following line  </p>
  
  <pre><code>routes.MapRoute(
                  name: "Default",
                  url: "{controller}/{action}/{id}",
                  defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
              );
  </code></pre>
  
  <p>to</p>
  
  <pre><code>routes.MapRoute(
                      name: "Default",
                      url: "{controller}/{action}/{id}",
                      defaults: new { controller = "Account", action = "Login", id = UrlParameter.Optional }
                  );
  </code></pre>
  
  <p>I changed this line because i found a extra redirect, that first user will go to home and then from there he will be redirected to login page due to authorization failure. have a look at following console error</p>
  
  <blockquote>
    <p><a href="http://localhost:51381/Document/Document/GetCategoriesByDocumentType?categoryDocumentType=1&amp;_=1480570187959" rel="nofollow noreferrer">http://localhost:51381/Document/Document/GetCategoriesByDocumentType?categoryDocumentType=1&amp;_=1480570187959</a>
    404 (Not Found)</p>
  </blockquote>
  
  <p>as you can see that two controller name was appended. </p>
  
  <blockquote>
    <p>/Document/Document/</p>
  </blockquote>
  
  <p>My ajax call in separate Js file.</p>
  
  <blockquote>
    <p>var url = 'Document/GetDocumentGrid?CategoryDocumentType=' +
    CategoryDocumentType + '&amp;categoryId=' + CategoryList + '&amp;keywords=' +
    search + '&amp;isArchived=' + isArchived;</p>
  </blockquote>
  
  <p>and when i revert route config , all ajax call works as expected.</p>
  
  <p>what if i wanted my user to go on login page directly, instead of home? or i have to change all my ajax URL's ? And what is the reason of this behavior?</p>
  
  <p>Note: i cannot use any Razor syntax as i have separate js files and i dont want to change every Js file, as my project goes almost 90 pages :(</p>