DirectoryIndex index.html
ErrorDocument 404 /404.html

<IfModule mod_rewrite.c>
  RewriteEngine On

  RewriteRule ^_next/ - [L]
  RewriteRule (^|.*/)__next[._].*\.txt$ - [L]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !/$
  RewriteRule ^(.+)$ /$1/ [R=302,L]
</IfModule>
