title: getting 404 for links with create-react-app deployed to github pages
body: <p>I'm trying to deploy a create-react-app to a relative path on GitHub pages with a custom domain. E.g. <code>www.example.com/myproject</code></p>
  
  <p>I'm using <code>react-router-dom</code>, <code>react-router-redux</code> and <code>react-router-bootstrap</code></p>
  
  <p>I've set homepage to <code>http://www.example.com/myproject</code> in <code>packages.json</code> (tried <code>homepage = "."</code> too) and also configured basename for my history:</p>
  
  <pre><code>...
  export const history = createHistory({ basename: '/myproject' });
  const middleware = [thunk, routerMiddleware(history)];
  ...
  const composedEnhancers = compose(applyMiddleware(...middleware), ...enhancers);
  const store = createStore(rootReducer, initialState, composedEnhancers);
  </code></pre>
  
  <p>The deployed app works on <code>www.mydomain.com/myproject</code> and I can navigate via the app links. </p>
  
  <p>But I got 404 when I try to enter a path directly (eg. <code>www.example.com/myproject/account</code>) or if I do browser refresh on a subpage.</p>
  
  <p>Long term goal is to configure different relative paths for dev and prod environments as described in <a href="https://stackoverflow.com/a/42825400/4006001">this answer</a> but first I just need to make it work in deployment.</p>