title: Angular $routeProvider not working for Apache Server
body: <p>I'm having a pickle with this at the moment. I'm running this angular front-end locally (localhost) with a Apache Server on Linux. When I try to access localhost, everything works great and I get my index.html. But now I have a link in index.html which should redirect the user to localhost/users. But I cant seem to get this working, I have tried every single solution on SO, but nothings seems to be working. Maybe some of you see what I'm doing wrong?</p>
  
  <p>my app.js</p>
  
  <pre><code>(function() {
  var app = angular.module('linkrec', ['ngRoute']);
  
  app.config(function($routeProvider, $locationProvider) {
      $locationProvider.html5mode(true).hashPrefix('!');
      $routeProvider
  
          .when('/users', { 
              templateUrl: '/users.html', 
          });
  });
  
  
  app.controller('UsersController', [ '$http', function($http) {
      var linkrec = this;
      linkrec.users = [];
  
      $http.get('https://localhost:9443/users').success(function(data){
          linkrec.users = data;
      });
  } ]);
  </code></pre>
  
  <p>})();</p>
  
  <p>my index.html</p>
  
  <pre><code>&lt;!DOCTYPE &lt;!DOCTYPE html&gt;
  &lt;html ng-app="linkrec"&gt;
      &lt;head&gt;
        &lt;title&gt;LinkRec&lt;/title&gt;
        &lt;link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css"&gt;
        &lt;link rel="stylesheet" type="text/css" href="linkrec.css"&gt;
      &lt;/head&gt;
      &lt;body&gt;
        &lt;script type="text/javascript" src="node_modules/angular/angular.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript" src="node_modules/angular/angular-route.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript" src="app.js"&gt;&lt;/script&gt;
  
        &lt;h1&gt;LinkRec&lt;/h1&gt;
        &lt;div class="container" ng-view&gt;
              &lt;a href="/users"&gt;&lt;h2&gt;Users&lt;/h2&gt;&lt;/a&gt;
              &lt;h2&gt;Vacancies&lt;/h2&gt;
              &lt;h2&gt;Groups&lt;/h2&gt;
        &lt;/div&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>my .htaccess used to be</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      RewriteEngine On
      RewriteBase /
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)       /index.html/#!/$1 
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>my .htaccess now</p>
  
  <pre><code># Apache .htaccess
  
  # angularjs pushstate (history) support:
  # See http://www.josscrowcroft.com/2012/code/htaccess-for-html5-history-pushstate-url/
  FallbackResource /index.html
  </code></pre>
  
  <p>Does anybody spot my mistake? The angular files are there and are correctly linked. Thanks in advance.</p>