Frontend Routing
Frontend Routing
Created on Sep 07, 2025, Last Updated on Sep 10, 2025, By a Developer
Redirection
Server can send a HTTP 302 response to redirect the client browser to visit another site. This is extremely useful when:
- The content got moved to another url, and to prevent the original one become invalid, server can redirect user to new spot
- Two step authentication, such as OAuth2.
- Error Handling or directing user to authenticate them self.
Static Redirection
Redirection can also happened without a web server. By setting a meta refresh in html head, browser can redirect by itself without the requirement of a 302 response code.
<meta http-equiv="refresh" content="3;url=https://www.mozilla.org" />
Rewrite
Rewrite happens outside of browser. It literally means alternating HTTP request on the fly, can be the proxy, reverse proxy, something hosted on CDN edge runtime, even the webserver itself. Any part of the request can be rewrote, source, destination, path, headers and etc.
Server Routing
Server pretty much means a routing behavior having remote server involved. However, there are multiple ways the server can serve the website.
- Statically serving filesystem based contents.
- Webserver dynamic render contents for different routes.
Client Routing
On contrast to server routing, client routing happens purely on browser. The website does not use <a href="..."/>
for routing, but update the path inside browser, to trigger some JavaScript behavior. The word Single Page Application (SPA) in framework like React and Vue means exactly this.