title: Route existing static html pages through symfony2
body: <p>I currently have a live Symfony2.4 application that also links to a directory on our server (called "guides") which is under in the "web" folder. The files in this folder are generated automatically using an external program into plain html files by another department in our company. </p>
  
  <p>Originally we had these files open to the public, but we'd like to make them only accessable if the user is logged into the application. We already have the site set up to handle the login process and such, I just can't figure out how to route the static files through Symfony so that I can have it use the Security process to check if the user is authorized to view the files.</p>
  
  <p>I know Symfony is setup so that static files will automatically get served, so I modified the htaccess file to include this:</p>
  
  <p>Anything that <strong>is</strong> a file and <strong>not</strong> in the "guide" directory should just get served. </p>
  
  <pre><code>RewriteCond %{REQUEST_FILENAME} -f
  RewriteCond %{REQUEST_URI} !/guides/
  RewriteRule .? - [L]
  </code></pre>
  
  <p>Then I tried to make a route that can catch all the urls coming from that directory and go through a special controller where I can check for Authorized Users and redirect to a login if bad, or show the actual page if good.</p>
  
  <pre><code>support_guides:
    path: /guides/{the-rest}
    defaults: { _controller: MillenniumSIMeevoSupportBundle:HelpGuide:show }
  </code></pre>
  
  <p>The htaccess seems to work (i think) as it doesn't try to serve the page directly, but now I just get the Symfony 404 page.</p>