Notes on Clean URL Routing in Apache

Notes on Clean URL Routing in Apache

Clean URLs make a site feel intentional. Getting /blog/page/2 and /blog/post/my-slug working without query strings only takes one .htaccess rule and a small router in index.php.

This post breaks down the regex, the fallback to a 404 page, and how the router dispatches to page templates.

URL routing diagram

Comments (0)