In the spirit of sharing with the community, a simple modx plugin and .htaccess rewrite to rewrite the ugly ?page=(.+?) url to something more fancy. Mind you, my business site will be Dutch so the word "pagina" refers to the English word "page".
The MODx Plugin, inits on the
OnWebPagePrerender event
<?php
if ($modx->event->name === 'OnWebPagePrerender') {
$output = $modx->resource->_output;
$output = preg_replace('%/(.+?)/\?page=(.+?)%mis', '$1/pagina-$2/', $output);
$modx->resource->_output = $output;
}
?>
And last but most certainly not least, the .htaccess rewrite that parses the urls and outputs them as querystring to the system.
RewriteCond %{REQUEST_URI} /(.+?)/pagina-(.+?)/ [NC]
RewriteRule (.*) /%1/?page=%2 [L,QSA,NC]
And for those who ask what my input URLs are (thanks for the suggestion b03tz)
Before: http://local/modx/nieuws/?page=2
After: http://local/modx/nieuws/pagina-2/
This item will also be featured on my blog later on.