Routing

التوجيه (Routing)

GLS-000154

Beginnerweb-basics1 min read
url routingclient routingpage routingnavigationapp routing

Definition

The system that maps URLs to pages or components in your app.

النظام الذي يعيّن URLs إلى صفحات أو مكونات في تطبيقك.

Why It Matters

Next.js file-based routing is one of its killer features. Every page on 404Fault — /projects, /glossary/[slug], /admin — exists because of a file in the /app directory.

التوجيه المعتمد على الملفات في Next.js هو أحد مميزاته الرائعة. كل صفحة في 404Fault — /projects و/glossary/[slug] و/admin — موجودة بسبب ملف في مجلد /app.

Full Definition

Routing determines which component or page is shown for a given URL. In Next.js App Router, routing is file-based — create a file at app/glossary/[slug]/page.tsx and Next.js automatically handles the route /glossary/anything. Navigation between pages happens without full page reloads using the Link component.
التوجيه يُحدد أي مكوّن أو صفحة تظهر لـ URL معين. في Next.js App Router، التوجيه يعتمد على الملفات — أنشئ ملفًا في app/glossary/[slug]/page.tsx وسيتعامل Next.js تلقائيًا مع المسار /glossary/أي_شيء. التنقل بين الصفحات يحدث دون إعادة تحميل كاملة للصفحة باستخدام مكوّن Link.
Knowledge Graph

Avoid these mistakes when using Routing:

1

Confusing App Router and Pages Router conventions

2

Forgetting that [slug] must be accessed via params.slug in the component

Sign in to unlock guided AI explanations from AI Teacher.

Generate a Prompt

Copy this prompt and use it directly with any AI model — no setup needed.

Ready-to-Use Prompt
Help me build a project using Routing.

Explain:
1. What is Routing and why it matters
2. The core architecture and required tools
3. Step-by-step implementation plan
4. Common mistakes to avoid: Confusing App Router and Pages Router conventions, Forgetting that [slug] must be accessed via params.slug in the component
5. Best practices and production tips

Official Resources