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 |
|---|---|---|
|
Product number 42 2026: hello pad |
?products/42 resolves the same way, so the application runs on a server
that routes no paths, and /shop/index.php/products/42 works everywhere.
A bracketed file is never reached by its own name.?page link keeps working: on a clean URL, a query string that starts
with a bare page name - the relative href="?about" - names that page.$padCleanUrls = TRUE in _config/config.php makes
$padGo write /shop/products/42. Apache needs one line,
FallbackResource /shop/index.php; php -S needs nothing.