Clean URLs

A page is named in the query string - /shop/?products/42 - or by the path behind the application: /shop/products/42. The path is mapped onto the files, and a file or directory whose name is a bracketed variable name stands for any one segment. The segment becomes that variable before the page's PHP runs:

url file variables
/shop/products/42 products/[id].pad $id is 42
/shop/products/new products/new.pad a name of its own wins over a bracket
/shop/blog/2026/hello-pad blog/[year]/[slug].pad $year and $slug
/shop/docs/a/b docs/[path+].pad $path is the rest, a/b

The same names resolve wherever a page is named - here through {page}, with shop/products/[id].pad and shop/blog/[year]/[slug].pad beside the fragment:

PHP
HTML
fragments/clean_urls_1.pad
Result
{page "fragments/shop/products/42"}
{page "fragments/shop/blog/2026/hello-pad"}

Product number 42

2026: hello pad