ruby
Next.js
Generative-AI
Updated: 7/14/2025, 10:19:28 AM
7/14/2025, 10:19:28 AM
Layout.tsxは配置されているディレクトリの中身に適用される
Layout.tsx
→ not-found.tsxとpage.tsxとで違うディレクトリにすれば良い.
not-found.tsx
page.tsx
→ 普通のディレクトリにいれるとルーティングされるので,論理グループを使う
txtapp/ (default_site)/ /page.tsx about/page.tsx contact/page.tsx layout.tsx (error_layout)/ layout.tsx not-found.tsx components/ utils/
txt
このように配置すればいい
参考 How to remove the Layout on 404 page
No headings