URL rewriting
Definition
URL rewriting maps a requested address to another internal or external address according to rules.
In URL rewriting, a server processes an address based on defined rules and maps it to another target. Internal rewriting can leave the visible browser address unchanged. A redirect instructs the browser to call a different address.
Simply explained
A human-readable address can internally lead to a technical file without you having to see this internal address in the browser.
Why it matters in practice
Rewriting enables understandable addresses and the mapping of old or standardized paths to an existing application.
Example from business
Possible example: The server internally processes /products/lamp via an application script that obtains the requested product ID from the path.
Limits and pitfalls
- Rewriting and redirecting are not the same. Faulty rules can create loops or allow unwanted redirects with unchecked target addresses.
Origin & history
Web servers developed rule-based URL processing to decouple public address structures from files and internal application paths.
Use in mid-sized companies
- Companies can document URL rules and test them with typical and invalid requests before a website migration goes live.
Frequently asked questions
Does the browser address always change in the process?
No. With internal rewriting, it usually remains unchanged; an external redirect leads to a new request.
Sources
- o. J., Apache mod_rewrite Introduction · Apache Software Foundation, o. J., Apache mod_rewrite Introduction
Editorially reviewed on: