Skip to main content

Route

PropertyValue
descriptionRoute
tagsref

Overview

A route is the mapping between a request or URL and the code or content that should handle it. In websites and apps, routing determines what page, template, component, or handler responds when someone visits a path.

It is closely related to URL, frontend, backend, and framework behavior such as Next.js. Routing matters because navigation, information architecture, and application behavior all depend on it.

What a Route Does

A route connects an addressable location to application behavior.

Depending on the stack, a route may point to:

  • a page or template
  • a component tree
  • an API handler
  • a redirect
  • a file download
  • a dynamic content resolver

The route is the entry point. It decides what logic runs and what response or screen the user receives.

Common Route Types

Routing can appear in several forms:

  • static page routes such as /about
  • dynamic routes such as /blog/my-post
  • API routes such as /api/users
  • nested routes that render children inside parent layouts
  • protected routes that require authentication or permissions
  • redirect routes used during migrations or URL changes

Different frameworks expose these patterns differently, but the underlying idea is the same.

Client-Side vs Server-Side Routing

Routes can be resolved in the browser, on the server, or in a mix of both.

  • Client-side routing is common in single-page apps and can make navigation feel faster after the initial load.
  • Server-side routing resolves the request before the response is sent, which can simplify initial delivery, SEO, and access control.

Modern frameworks often combine both approaches, especially when using SSR, ISR, or hybrid rendering.

Why Routing Matters

Routing affects more than just page loading.

  • It shapes site structure and navigation.
  • It influences caching and rendering behavior.
  • It determines how dynamic content is fetched or resolved.
  • It affects redirects, migrations, and long-term URL stability.

That is why routing decisions often sit close to deployment, frontend, backend, and SEO concerns.

Frequently Asked Questions

Is a route the same as a URL?

Not exactly. A URL is the address a user requests. A route is the application mapping that decides what should handle that request.

Can routes be dynamic?

Yes. Many systems use dynamic segments such as IDs or slugs so one route definition can serve many pages or records.

Do only frameworks have routes?

No. Even simpler websites and servers still rely on some routing behavior, whether it is explicit in code or implicit in file and server configuration.