-
Notifications
You must be signed in to change notification settings - Fork 27.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resulting in "404 Not Found" on manual navigation to subdirectory and on refresh #53405
Comments
Hi, this sounds like a hosting-specific issue, can you provide your deployment URL? Or can you reproduce it locally (eg.: |
I tested it on my computer, and after I ran as you can see it links to |
nginx.conf Refresh to jump to the home page... |
`location / { 将以.html结尾的请求添加Cache-Control头信息if ($uri ~* .(html)$) { 默认情况下,根据路径转发,找不到加载index.htmltry_files $uri /$uri.html /index.html; |
I have the same problem when I 'next build' and 'static export' to out, then deploy the out to Nginx. |
"Next.js generates an HTML file per route", but when I use [param] for route, next build will not generates the HTML file for the route. I found that's the problem. So I have to remove all [param] from app ruote path. |
是的。[param]是服务器渲染用的。你需要修改一下你的传参数方式。 |
This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you. |
This issue has been automatically closed due to two years of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding! |
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
Static HTML Export (output: "export")
Link to the code that reproduces this issue or a replay of the bug
https://github.com/GnussonNet/nextjs-bug
To Reproduce
Create a new nextjs project using default values
npx create-next-app@latest
Change next.config.js
Create a folder inside app (ex, about) and add a page.tsx
Remove all content in app/page.tsx and add a next/link to "/about"
In app/about/page.tsx, add a div with "about" text inside.
Build project
npm run build
Transfer all files from out/ to one.com via SFTP
Go to domain, navigate to /about by using the Link, refresh (Gives 404 not found)
Manually enter domain /about (gives 404 not found)
Describe the Bug
Described above
Expected Behavior
Expected behavior is to be able to navigate and refresh the page without getting a "404 Not Found" response and be able to directly access subdirectories via domain.com/about
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
SFTP to one.com
The text was updated successfully, but these errors were encountered: