I have been doing a blog with next.js and I am creating the header, but the links are not working, I read the next.js documentation and made the links step by step, but every time I reload my website and click the links, my console says :" GET https://gdjly5-3000.csb.app/About 404 (Not Found)". I doble-check the spelling-mistakes and the folder and seems ok. I am confused. Can somebody help me? Thanks a lot Here is the Intro.tsx
import Link from "next/link";
import Image from "next/image";
import logo from "./image/emily-logo.jpg";
export default function Intro() {
return (
<section>
<nav>
<a href="/">HOME </a>
<Link href="/intro-pages/about">ABOUT</Link>
<Link href="/intro-pages/blog">BLOG</Link>
<Link href="/intro-pages/Press">PRESS</Link>
<Link href="/intro-pages/Services">PERSONAL STYLED SERVICES</Link>
</nav>
<Image alt="emily-logo" className="logo-header" src={logo} />
</section>
);
}
Here is the Page.tsx
import Container from "@/app/_components/container";
import { HeroPost } from "@/app/_components/hero-post";
// import { Intro } from "@/app/_components/intro";
import Intro from '@/app/_components/intro'
import {SocialMedia} from '@/app/_components/SocialMedia'
import {HomePage} from '@/app/_components/HomePage'
import {Testimonial} from '@/app/_components/Testimonial'
import { MoreStories } from "@/app/_components/more-stories";
import { getAllPosts } from "../lib/api";
export default function Index() {
const allPosts = getAllPosts();
const heroPost = allPosts[0];
const morePosts = allPosts.slice(1);
return (
<main>
<Container>
<Intro />
<HomePage/>
<SocialMedia/>
<Testimonial/>
<HeroPost
title={heroPost.title}
coverImage={heroPost.coverImage}
date={heroPost.date}
author={heroPost.author}
slug={heroPost.slug}
excerpt={heroPost.excerpt}
/>
{morePosts.length > 0 && <MoreStories posts={morePosts} />}
</Container>
</main>
);
}
Here is the about.txs
export function About() {
return (
<section>
<h1>This is the About Page</h1>
</section>
);
}
Above I show you where every component is located

It looks like the
404 erroryou're encountering is because yourintro-pagesare located in the_componentsfolder, not directly inside theappfolder. To fix this, you'll need to create a new folder namedaboutand within it, apage.tsxfile.I suggest checking the official Next.js website for guidance on structuring your project: https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts#pages
According to the documentation:
Therefore, your folder structure should resemble the following:
This setup ensures that your pages are correctly located for Next.js to route them properly. Moving the
_componentsfolder outside of the app but still within src will also help keep your project organized and maintain a clear separation between your components and pages.To wrap up, make sure your pages are located in the correct directories as per Next.js conventions to avoid routing issues. Adjusting your project structure as recommended should resolve the 404 error. Happy coding!