title: Statically served NextJS website is adding a trailing slash on page refresh
body: <p>I have a NextJS website statically served on an apache server and using an <code>.htaccess</code> file to setup the routing rules etc. This files looks like this</p>
  <pre><code>Options +FollowSymLinks
  RewriteEngine On
  RewriteCond %{ENV:HTTPS} !=on
  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  
  &lt;IfModule mod_rewrite.c&gt;
  
      RewriteEngine On
      RewriteRule ^([^/]+)/$ $1.html
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^([^/]+)/$ $1.html
      RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.html
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
      RewriteRule (.*)$ /$1/ [L,R=301]
  &lt;/IfModule&gt;
  </code></pre>
  <h2>The problem I'm facing:</h2>
  <p>My internal links look like <code>example.com/page-1</code>, so when I redirect from <code>example.com</code> to <code>example.com/page-1</code> everything is working well.</p>
  <p>But when I target this page directly from it's URL or reload the page the server is adding a extra trailing slash to the URL. e.g. <code>example.com/page-1/</code></p>
  <p>This causes duplicate content within search engines /</p>
  <h2>What I'm looking for:</h2>
  <p>I'm looking for a solution in my <code>.htaccess</code> that prevents the server from adding a trailing slash on reloading the page. But URL's like <code>example.com/about/page-1</code> should keep working.</p>