You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm deploying a next.js app as a static export, to an s3 bucket configured for static website hosting.
I use next's build and export commands to generate the out/ directory and then copy that into my s3 bucket
The bucket then contains some files, for simplicity lets say there's just index.html and about.html
The problem is when a user hits index.html via www.website.com then navigates to www.website.com/about everything works, but reloading www.website.com/about fails of course.
www.website.com/about.html finds the correct asset to render the site however
Is there a way to export a static next.js app, host on s3, and have requests to /about proxy /about.html ?
As always, thanks for looking, and thanks even more for participating.
The text was updated successfully, but these errors were encountered:
On your next.config.js file at the root of the project.
module.exports={trailingSlash: true,}
Now you can create your pages (e.g. about.jsx) inside the pages directory and Next will create a folder with the file name with an index.html file inside of it when you run the export command.
I'm deploying a next.js app as a static export, to an s3 bucket configured for static website hosting.
I use next's
build
andexport
commands to generate theout/
directory and then copy that into my s3 bucketThe bucket then contains some files, for simplicity lets say there's just
index.htm
l andabout.html
The problem is when a user hits
index.html
viawww.website.com
then navigates towww.website.com/about
everything works, but reloadingwww.website.com/about
fails of course.www.website.com/about.html
finds the correct asset to render the site howeverIs there a way to export a static next.js app, host on s3, and have requests to
/about
proxy/about.html
?As always, thanks for looking, and thanks even more for participating.
The text was updated successfully, but these errors were encountered: