title: MVC3 with razor web.config authorization for default route
body: <p>I am new to MVC and my question is this how can I setup my sites root to point to a specific Controller + Action and then in the Web.config file set the location + path of the root of the site, so eg: <a href="http://localhost:8080/" rel="nofollow">http://localhost:8080/</a> to be able to be accessed by all anonymous and logged in.</p>
  
  <p>I have been playing with the location and path but just cant figure it out and in my Global.asax, I am not sure I have the right root to Home + Index as controller + Action.</p>
  
  <p>Here is some code:</p>
  
  <p><strong>web.config (snippets)</strong></p>
  
  <pre><code>&lt;authentication mode="Forms"&gt;
      &lt;forms loginUrl="~/Account/LogOn" timeout="2880"/&gt;
  &lt;/authentication&gt;
  &lt;authorization&gt;
      &lt;deny users="?" /&gt;
      &lt;allow users="*" /&gt;
  &lt;/authorization&gt;
  </code></pre>
  
  <p>I am not sure what the <code>&lt;location path=""&gt;</code> of the root of the site should be.</p>
  
  <p><strong>Global.asax (snippets)</strong></p>
  
  <pre><code>public static void RegisterRoutes(RouteCollection routes)
  {
      routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
      routes.MapRoute(
             "Default", // Route name
             "{controller}/{action}/{id}", // URL with parameters
              new { controller = "Home", action = "Index", id = UrlParameter.Optional }
             );
  }
  </code></pre>
  
  <p>The default route in Global.asax for the site I would like it to go to the <em>Home Controller</em> and the <em>Action Index</em>, so when you type <a href="http://localhost:8080/" rel="nofollow">http://localhost:8080/</a></p>
  
  <p>Thanks in advance.</p>