Suggestion
cases- mode_rewrite OFF (default)
- mode_rewrite ON
Step 1
mod_rewrite places all stuff into
page=
and all other routing will be done by http class.htaccess is static
Step 2
rules be written in config/router.conf as our own mod_rewrite-like
config->standard_handlers
will be loaded dynamically by glob'ing handler/page/*.php filesadditional cases can be configured as follows (admin.php, index.php, robots.txt, sitemap.xml, favicon.ico) but were used only for reserved words testing on page creation.
additionally it will be not allowed to use any of these predefined reserved words:
-
12345
-
12345rev12
-
HASHID
then - incoming router:
there can be multiple rules, all prefixes can be checked and processed, all SEO tails can be configured to be discarded on arrival, etc
'#^[0-9a-z]+$#i hashid=$0 redirect' '#^([0-9]+)rev([0-9]+)$# id=$1 version=$2 redirect' '#^([0-9]+)$# id=$1 redirect' '#^(.+?)/rev([0-9]+)/{method}(/.*)?$# page=$1 version=$2 method=$3' '#^(.+?)/{method}(/.*)?$# page=$1 method=$2 version=?version_id' // from _GET '#^(.+?):seo-.*$# page=$1 ' 'default page=$0 create'
default: method=show version=latest
other possibilities:
hashid=
/ page_id=
/ page=
quasi-assignments is a check-it rules also - so if
$0
is not hashid, or if $1
is not a page - if the rule fails, then search continues
- if none found - 404, but only default rule will give "wanna create?" possibility
http class will need to search for pages by itself to process the router
redirect will redirect to canonical form URL, which I propose to be
PAGE[/revVERSION][/METHOD]
(older revisions will be set as noindex/nofollow) but it can be made configurable
generation of permalinks - is done by
{{action}}
and can be generated any possible wayseems like it covers ALL possible cases, prefixes or not, can be extended then too