eaidy
eaidy

Reputation: 600

Next.js - 404 error without .html extension when deploying static output

My website uses Next.js and is deployed with static output using FileZilla.

I can reach the root of my website without a .html extension, like seen below:

https://www.mywebsite.com

When I try to reach any other page on the server I get a 404 error unless I provide the .html extension.

Doesn't work: https://www.mywebsite.com/en/marine/modelvirtue
Works: https://www.mywebsite.com/en/marine/modelvirtue.html

This does not happen when I run my project in development mode using VSCode.

Upvotes: 0

Views: 255

Answers (1)

Daniel
Daniel

Reputation: 449

Add trailingSlash: true to next.config.js should fix this.

Upvotes: 0

Related Questions