title: React Router v4 - Redirect to home on page reload inside application
body: <p>I need to redirect to home page when user refreshes other pages inside my application. I am using <code>React router</code> v4 and <code>redux</code>. Since the store is lost on reload, the page user reloaded is now empty and hence I want to take him back to a page that does not need any previous stored data. I don't want to retain state in <code>localStorage</code>.</p>
  
  <p>I tried to handle this in event <code>onload</code> but it did not work:</p>
  
  <pre><code>window.onload = function() {
      window.location.path = '/aaaa/' + getCurrentConfig();
  };
  </code></pre>