title: rewrite rules for apache 2 to use with angular js
body: <p>Obviously, there are a lot of mod rewrite discussions and answers all across the web. However, I am having a hard time grasping them. So I thought I would ask here.</p>
  
  <p>I'm asking for rewrite rules to do what Andy Joslin explained in the comments here: <a href="https://stackoverflow.com/a/11100438">https://stackoverflow.com/a/11100438</a></p>
  
  <p>This is my current dir structure at the root of example.com</p>
  
  <ul>
  <li>app/</li>
  <li>app/index.html (the "root" of the angular js application)</li>
  <li>api (This will be a symfony 2 app that is used for the 'api'. I'll be sending ajax requests to and from here from angular.)</li>
  </ul>
  
  <p>I would like to redirect all requests to app/index.html except for requests to /api.</p>
  
  <p>For example:</p>
  
  <p><a href="http://example.com/categories/electronics/ipod" rel="noreferrer">http://example.com/categories/electronics/ipod</a> would actually be like going to <a href="http://example.com/app/index.html/categories/electronics/ipod" rel="noreferrer">http://example.com/app/index.html/categories/electronics/ipod</a></p>
  
  <p>I would like for the app/index.html part to be hidden however.</p>
  
  <p>Then, there would be an exception for requests to <a href="http://example.com/api" rel="noreferrer">http://example.com/api</a> because I will need to make ajax requests to those url paths.</p>
  
  <p>Thanks for any and all help/guidance.</p>