title: How to add sitemap.xml in an angularjs app
body: <p>I have created an angularjs app using <a href="https://github.com/angular-fullstack/generator-angular-fullstack" rel="nofollow noreferrer">generator-angular-fullstack</a>. Things are working good except one. I'm trying to add sitemap.xml to this app so that it can be indexed by search engines crawlers. Using the approach mentioned <a href="https://stackoverflow.com/questions/20523274/how-can-i-add-sitemap-xml-to-angularjs-site">here</a>, I created a sitemap.xml in my <strong>client/</strong> directory. It is working properly on Development Environment when I start my application using <em>grunt serve</em> but on Production, it's not working when I'm starting the app using <em>grunt serve:dist</em>. This is my robots.txt <a href="https://crowdvirality.com/robots.txt" rel="nofollow noreferrer">https://crowdvirality.com/robots.txt</a> Whenever I try to access <a href="https://www.crowdvirality.com/sitemap-secure.xml" rel="nofollow noreferrer">https://www.crowdvirality.com/sitemap-secure.xml</a> or <a href="https://www.crowdvirality.com/sitemap.xml" rel="nofollow noreferrer">https://www.crowdvirality.com/sitemap.xml</a>, it redirects me to <a href="https://www.crowdvirality.com/error" rel="nofollow noreferrer">https://www.crowdvirality.com/error</a> page.</p>
  <p>My app.js contains following rule:</p>
  <blockquote>
  <pre><code>  .config(function ($stateProvider, $urlRouterProvider, $locationProvider, $httpProvider, cfpLoadingBarProvider) {
      $urlRouterProvider
        .otherwise('/error');
    })
  </code></pre>
  </blockquote>
  <p>This same set up works on local dev environment but fails on prod. Can anyone give me some pointers where I'm doing wrong ?</p>
  <p>Thanks</p>