Request handling
bugs:issue[link1] in bugtrackerAuthor: RideSnowNow[link2]
Introduction
1. Permalink2. Link shortening
3. Seo Friendly Url
4. Canonical URLs
Request index.php?
- [page=][tag][handler][other parameters for actions, whatever]
- [page_id=][page_id]&[version_id]
- [hashid=][hashid]&[]
rewrite OFF
- ?page=WackoWiki
- ?page_id=5
- ?page_id=5&sef_tag=WackoWiki-Handbook-for-Beginners
- ?page_id=5&sef_tag=WackoWiki-Handbook-Quick-HowTo (not necessarily unique !)
rewrite ON
- WackoWiki
- ID/5
- ID/5/WackoWiki-Handbook-for-Beginners
- ID/5/WackoWiki-Handbook-Quick-HowTo (not necessarily unique !)
Implementation Notes
- init->request and wacko->run($tag, $method = ' ')
- ->page
- new cases
- + page_id
- + sef
- new cases
- ->method
- ->page
API Changes
- function load_page($tag, $page_id, $time = '', $cache = LOAD_CACHE, $metadataonly = LOAD_ALL)
Configuration
- default_request = [tag | page_id | page_id&sef | sef]
Implementation Log
- UriRouter[link3]
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 files
additional 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
(maybe configured too)
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 way
seems like it covers ALL possible cases, prefixes or not, can be extended then too
Other Changes
Related Links
- Canonicalization[link4]
- Allowed Characters[link5]
- URL as UI[link6]
Future Ideas
Feedback
- Please provide feedback
- [link1] https://wackowiki.org/bugs/view.php?id=issue
- [link2] https://wackowiki.org/doc/Users?profile=RideSnowNow
- [link3] https://wackowiki.org/doc/Dev/Projects/UriRouter
- [link4] http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=139066
- [link5] https://tools.ietf.org/html/rfc3986#section-2
- [link6] https://www.nngroup.com/articles/url-as-ui/