title: Next.JS Dynamic route static export project opened in new tab or reload the page leads to 404
body: <p>I have a VPS with Apache + Cpanel.
  I can't configure Nginx over it, so the only way, as far as I know, is to 'static export' first then deploy it.
  Turns out I can't access the product page by link pasted on url bar directly (not by click a link text).
  The link is look like this : <code>www.example.com/products/4</code> or <code>www.example.com/products/213</code>
  My first suggestion is because I 'static export' the project.</p>
  
  <p>I use next-routes with <code>&lt;Link /&gt;</code></p>
  
  <p>My code</p>
  
  <pre class="lang-js prettyprint-override"><code>import React, { Component } from 'react';
  import { withRouter } from 'next/router';
  import { connect } from 'react-redux';
  import fetch from 'isomorphic-fetch';
  import Navbar from '../components/Navbar';
  import Footer from '../components/Footer';
  import CheckoutBody from '../components/CheckoutBody';
  
  class Product extends Component {
      static async getInitialProps({ query }) {
          let { id } = { ...query };
          if (id === undefined) id = 14;
          const res = await fetch(`http://www.example.com/api/product?id=${id}`);
          const data = await res.json();
          return { campaignDetail: data };
      }
  
      render() {
          let { lang } = this.props;
  
          return (
              &lt;React.Fragment&gt;
                  &lt;Navbar /&gt;
                  &lt;CheckoutBody
                      key={this.props.productDetail.id}
                      productDetail={this.props.productDetail}
                      lang={lang}
                  /&gt;
                  &lt;Footer /&gt;
              &lt;/React.Fragment&gt;
          );
      }
  }
  
  export default Product ;
  
  </code></pre>
  
  <p>Same question but different problem: <a href="https://github.com/zeit/next.js/issues/9893" rel="nofollow noreferrer">https://github.com/zeit/next.js/issues/9893</a></p>
  
  <p>I have tried this to .htaccess. It is not working. I am very newbie to regex and htaccess.</p>
  
  <pre><code>RewriteCond %{REQUEST_FILENAME}.html -f
  RewriteRule !.*\.html$ %{REQUEST_FILENAME}.html [L]
  </code></pre>
  
  <ol>
  <li>What should I do? </li>
  <li>Is it what it's called dynamic routes?</li>
  </ol>