Skip to main content
miji.be

URL Rewrite

A server-side technique that internally maps a requested URL to a different resource without changing the URL displayed in the browser.

May 1, 2026 / About 1 min read

Redirect

A URL rewrite is a server-side operation that internally translates a requested URL to a different path or resource without the browser being aware of the change. Unlike a redirect, which sends the browser to a new URL, a rewrite happens entirely on the server: the browser's address bar continues to show the original URL while the server serves content from a different location.

URL rewrites are commonly configured in web server software like Apache (using mod_rewrite) or Nginx (using rewrite directives). They enable clean, user-friendly URLs that map to complex backend paths. For example, a request for "example.com/products/shoes" might be internally rewritten to "example.com/index.php?category=shoes" without the user ever seeing the query string.

The key difference between rewrites and redirects is visibility. A rewrite is invisible to the client and happens in a single request-response cycle. A redirect sends a response telling the client to make a new request to a different URL, resulting in two request-response cycles and a visible URL change in the browser.

In URL shortening, rewrites are less common than redirects because the goal is typically to send the user to an external destination URL, which requires a redirect. However, rewrites may be used internally within the shortening service's infrastructure to route requests to different backend handlers.

Was this article helpful?

Related Terms

301 Redirect

A permanent HTTP redirect that tells browsers and search engines the resource has moved permanently to a new URL.

Server-Side Redirect

A redirect handled by the web server before any page content is sent to the browser, using HTTP status codes like 301 or 302.

CNAME Record

A CNAME record maps one domain name to another in DNS. Used to point custom branded short URL domains to the URL shortening service infrastructure without changing IP addresses directly.

Reverse Proxy

An intermediary server that receives requests from clients and forwards them to the servers behind it. It handles load balancing, SSL termination, and caching.

Server

A computer that provides data and services to other devices over a network. Web servers, mail servers, and DNS servers each handle different types of requests.

Custom Alias

A custom alias is a user-defined short code that replaces the auto-generated random string in a short URL. It improves brand recognition, memorability, and click-through rates.

Related Articles

Self-Hosting a URL Shortener: Full Link Control

Explore the benefits and challenges of running your own URL shortening service. Covers open-source tools, serverless architecture, and cost-performance tips.

301 vs 302 Redirects - Choosing the Right Type for Short URLs

Understand the differences between 301 and 302 HTTP redirects. Learn how each type affects SEO, analytics, and performance for short URLs.

How URL Shorteners Work - The Technical Side of Redirects

Discover the technical mechanics behind URL shortening: hash generation, database lookups, HTTP redirects, and more. Includes HTTP response examples and base-62 encoding calculations.

FAQ

What's the difference between URL rewriting and redirecting?
A redirect instructs the browser to access a new URL, while URL rewriting transforms the URL internally on the server; the browser still displays the original URL.
In what situations is URL rewriting used?
It's used for converting dynamic URLs to static-looking ones, API versioning, and routing in multi-tenant applications.

Put the terms to work

Shorten a URL for Free