Process Flow - Rewrite directive
Request comes in
Check rewrite rule pattern
Rewrite URL
Redirect or internal rewrite
Send response
The rewrite directive checks if the incoming URL matches a pattern. If yes, it rewrites the URL and either redirects or internally rewrites before sending the response.