短.be

URL Rewrite

Sep 15, 2025 · 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 "/products/shoes" might be internally rewritten to "/index.php?category=shoes" without the user ever seeing the query string. Web server configuration books on Amazon provide detailed examples.

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. System architecture books on Amazon discuss routing patterns.

Related Terms

Ready to create a short URL?

Shorten a URL for Free