title: Spring boot: Configure your tomcat server to work with html5Mode
body: <p><strong>Question: how to configure .htaccess in spring boot?</strong></p>
  
  <p>angularjs provides html5Mode, which makes your app use pushstate-based URL instead of hashtags. However this requires server side support, since the generated urls need to be rendered properly as well.</p>
  
  <p>If you're running your angular app on an apache server you can easily add this rule in an .htaccess file.</p>
  
  <pre><code># Apache .htaccess
  
  # angularjs pushstate (history) support:
  # See http://www.josscrowcroft.com/2012/code/htaccess-for-html5-history-pushstate-url-routing/
  &lt;ifModule mod_rewrite.c&gt;
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_URI} !index
      RewriteCond %{REQUEST_URI} !.*\.(css¦js|html|png) #Add extra extensions needed.
      RewriteRule (.*) index.html [L]
  &lt;/ifModule&gt;
  </code></pre>