title: React js routing not working on server
body: <p>can anyone tell what's wrong with my code?</p>
  
  <p>All routes works on localhost (HashRouter) but on server the last route does not work. When I access https:www.example.com/invoice_data/a/b -> only "spinner" is visible which looks like the const isFetched is false, but it is not, because other routes works correctly.</p>
  
  <pre><code>render(){
  const {language, langRequest} = this.props;
    const isFetched = langRequest.isFetched;
    let intlData = {};
    if (isFetched) {
       intlData = {
          locale: language,
          messages: langRequest.localeData[language].data
       };
       return process.env.NODE_ENV === 'production' ? (
           &lt;IntlProvider key="intl" {...intlData}&gt;
               &lt;BrowserRouter&gt;
                   &lt;Switch&gt;
                       &lt;Route exact path='/' render={(props) =&gt; &lt;p&gt;Home&lt;/p&gt;}/&gt;
                       &lt;Route exact path='/terms' render={(props) =&gt; &lt;ExtraPage content="terms_list"/&gt;}/&gt;
                       &lt;Route exact path='/terms/licence' render={(props) =&gt; &lt;ExtraPage content="licence"/&gt;}/&gt;
                       &lt;Route exact path='/terms/personal' render={(props) =&gt; &lt;ExtraPage content="personal"/&gt;}/&gt;
                       &lt;Route exact path='/password/:hash' render={(props) =&gt; &lt;ExtraPage content="password" {...props}/&gt;}/&gt;
                       &lt;Route exact path='/invoice_data/:hash/:idata' render={(props) =&gt; &lt;ExtraPage content="invoice" {...props}/&gt;}/&gt;
                       &lt;Route component={NotFound}/&gt;
                   &lt;/Switch&gt;
               &lt;/BrowserRouter&gt;
           &lt;/IntlProvider&gt;
       ) : (
           &lt;IntlProvider key="intl" {...intlData}&gt;
               &lt;HashRouter&gt;
                   &lt;Switch&gt;
                       &lt;Route exact path='/' render={(props) =&gt; &lt;p&gt;Home&lt;/p&gt;}/&gt;
                       &lt;Route exact path='/terms' render={(props) =&gt; &lt;ExtraPage content="terms_list" footer="sticky"/&gt;}/&gt;
                       &lt;Route exact path='/terms/licence' render={(props) =&gt; &lt;ExtraPage content="licence"/&gt;}/&gt;
                       &lt;Route exact path='/terms/personal' render={(props) =&gt; &lt;ExtraPage content="personal"/&gt;}/&gt;
                       &lt;Route exact path='/password/:hash' render={(props) =&gt; &lt;ExtraPage content="password" {...props}/&gt;}/&gt;
                       &lt;Route exact path='/invoice_data/:hash/:idata' render={(props) =&gt; &lt;ExtraPage content="invoice" {...props}/&gt;}/&gt;
                       &lt;Route component={NotFound}/&gt;
                   &lt;/Switch&gt;
               &lt;/HashRouter&gt;
           &lt;/IntlProvider&gt;
       )
    }else{
       return(
           &lt;div className="loader-container centerizeH"&gt;
               &lt;div className="loader"&gt;
                   &lt;div className="spinner"&gt;
                       &lt;div className="dot1"&gt;&lt;/div&gt;
                       &lt;div className="dot2"&gt;&lt;/div&gt;
                   &lt;/div&gt;
               &lt;/div&gt;
           &lt;/div&gt;
       )
    }
   }
  </code></pre>
  
  <p>.htaccess config:</p>
  
  <pre><code>  RewriteEngine On  
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
    RewriteRule ^ - [L]
    RewriteRule ^ /index.html [L]
  </code></pre>