title: Node.js catch-all route with redirect always renders index page with Angular regardless of url
body: <p>Essentially when I use a catch-all route and use <code>res.redirect('/')</code> regardless of the url I enter it will always render the index/home page (ie Angular does not seem to 'see' the full url) however if I place <code>res.render('index')</code> in the catch-all route everything works fine. I don't want repeat code and redirecting to '/' should work, I have probably made a stupid mistake somewhere here and any help would be much appreciated!</p>
  
  <p>Angular routing:</p>
  
  <pre><code>app.config(function ($routeProvider, $locationProvider) {
  $locationProvider.html5Mode(true);
  
  $routeProvider
      .when('/', 
          {   
              templateUrl: 'partials/home.jade'
          })
      .when('/about', 
          {
              templateUrl: 'partials/about.jade'
          })
      .otherwise( {redirectTo: '/'});
  });
  </code></pre>
  
  <p>This will correctly render the about page when entering <code>site-address/about</code>:</p>
  
  <pre><code>app.get('/', function (req, res) {
      res.render('index');
  });
  
  app.get('/partials/:name', function (req, res) {
      res.render('partials/' + req.params.name);
  });
  
  app.get('*', function (req, res) {
      res.render('index');
  });
  </code></pre>
  
  <p>This will always just show the index page:</p>
  
  <pre><code>app.get('/', function (req, res) {
      res.render('index');
  });
  
  app.get('/partials/:name', function (req, res) {
      res.render('partials/' + req.params.name);
  });
  
  app.get('*', function (req, res) {
      res.redirect('/');
  });
  </code></pre>
  
  <p>Configuration if it helps: </p>
  
  <pre><code>// Configuration
  app.configure(function () {
      app.set('port', process.env.PORT || 1337);
      app.set('views', __dirname + '/views');
      app.set('view engine', 'jade');
      app.use(express.favicon());
      app.use(express.logger('dev'));
      app.use(express.bodyParser());
      app.use(express.methodOverride());
      app.use(express.static(path.join(__dirname, 'public')));
      app.use(app.router);
  });
  </code></pre>