title: How can I setup Laravel 3 routes for pages of focus on my default controller?
body: <p>There will be several high profile links for customers to focus on, for example: </p>
  
  <ul>
  <li>Contact Us @ domain.com/home/contact</li>
  <li>About the Service @ domain.com/home/service</li>
  <li>Pricing @ domain.com/home/pricing</li>
  <li>How It Works @ domain.com/home/how_it_works</li>
  </ul>
  
  <p>Stuff like that.  I would like to hide the <strong>home</strong> controller from the URL so the customer only sees <em>/contact/</em>, not <em>/home/contact/</em>.  Same with <em>/pricing/</em> not <em>/home/pricing/</em></p>
  
  <p>I know I can setup a controller or a route for each special page, but they will look the same except for content I want to pull from the database, and I would rather keep my code DRY.</p>
  
  <p>I setup the following routes:</p>
  
  <pre><code>Route::get('/about_us', 'home@about_us');
  Route::get('/featured_locations', 'home@featured_locations');
  </code></pre>
  
  <p>Which work well, but I am afraid of SEO trouble if I have duplicate content on the link with the controller in the URL.  ( I don't <em>plan</em> on using both, but I have been known to do dumber things.)</p>
  
  <p>So then made routes like these:</p>
  
  <pre><code>Route::get('/about_us', 'home@about_us');
  Route::get('/home/about_us', function() 
  { 
      return Redirect::to('/about_us', 301);
  });
  
  Route::get('/featured_locations', 'home@featured_locations');
  Route::get('/home/featured_locations', function() 
  { 
      return Redirect::to('/featured_locations', 301);
  });
  </code></pre>
  
  <p>And now I have a redirect.  It feels dumb, but it appears to be working the way I want. If I load the page at my shorter URL, it loads my content.  If I try to visit the longer URL I get redirected.</p>
  
  <p>It is only for about 8 or 9 special links, so I can easily manage the routes, but I feel there must be a smart way to do it.  </p>
  
  <p>Is this even an PHP problem, or is this an .htaccess / web.config problem?  </p>
  
  <p>What hell have I created with this redirection scheme.  How do smart people do it?  I have been searching for two hours but I cannot find a term to describe what I am doing.  </p>
  
  <p>Is there something built into laravel 4 that handles this?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Here is my attempt to implement one of the answers. This is <strong>NOT</strong> working and I don't know what I am doing wrong.</p>
  
  <p>application/routes.php</p>
  
  <pre><code>Route::controller('home');
  
  Route::controller('Home_Controller', '/');
  </code></pre>
  
  <p>(you can see the edit history if you really want to look at some broken code)</p>
  
  <p>And now <em>domain.com/AboutYou</em> and <em>domain.com/aboutUs</em> are returning 404.  But the <em>domain.com/home/AboutYou</em> and <em>domain.com/home/aboutUs</em> are still returning as they should.</p>
  
  <p><strong>FINAL EDIT</strong></p>
  
  <p>I copied an idea from the <a href="https://github.com/redbaron76/PongoCMS-Laravel-cms-bundle/blob/master/routes.php" rel="nofollow noreferrer">PongoCMS routes.php</a> (which is based on Laravel 3) and I see they used filters to get any URI segment and try to create a CMS page.</p>
  
  <p><a href="https://stackoverflow.com/a/14435311/24229">See my answer below using route filters</a>.  This new way doesn't require that I register every special route (good) but does give up redirects to the canonical (bad)</p>